Commit Graph

5274 Commits

Author SHA1 Message Date
Brian Salomon
82ddc94aff Make ProcessorRefTests op be a non-legacy GrMeshDrawOp
Change-Id: I80f8a7bad1fb8d499a3fec879ddd29ebbefe1eb6
Reviewed-on: https://skia-review.googlesource.com/23324
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-14 16:22:04 +00:00
Brian Salomon
b4b8a46448 Make PrimitiveProcessorTest's op be a non-legacy GrMeshDrawOp
Change-Id: I14c03c350e43dd576904d94a9f0847405dedd0a6
Reviewed-on: https://skia-review.googlesource.com/23142
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-14 16:20:04 +00:00
Brian Salomon
9a03642ad2 Make ops used in OnFlushCallbackTest be non-legacy GrMeshDrawOps.
Change-Id: Idf7f838bcdda200aeea1bfbcd5eea7cbebd76aa2
Reviewed-on: https://skia-review.googlesource.com/23005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-14 14:24:54 +00:00
Florin Malita
b00a36050a Purge cached SkPictureShader entries on shader deletion
We're currently adding picture shader cache entries to the resource
cache, but we don't ever purge.  To avoid exhausting the budget, add
logic to associate cached entries with their owning picture shader, and
purge when the shader is deleted.

-- Side note --

The current cache key is

 K(pictureID, ...)

so technically the cache entries are associated with the picture, not the
shader.  One could resonably argue we should only purge when the
*picture* is deleted.  Unfortunately, this doesn't work: the cache entries
contain indirect refs to the picture (SkImageShader -> SkImage_Generated
-> SkPictureImageGenerator -> SkPicture), so the picture is always kept
alive.

Associating the cache entries with the shader itself seems like a
reasonable alternative, even if we give up some cache persistence in the
process.

Change-Id: Ia115dbb5ae627e5ee171da7c4430fecfd42f4292
Reviewed-on: https://skia-review.googlesource.com/23380
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-07-14 14:19:34 +00:00
Greg Daniel
2811aa25f1 Add metal config to tools
Bug: skia:
Change-Id: I84dbd56c17d4856496af4491f340ec560e29c8a6
Reviewed-on: https://skia-review.googlesource.com/23200
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-14 13:57:34 +00:00
Mike Reed
907783bb77 don't test index8 -- no longer supported
Bug: skia:6828
Change-Id: I7ce4d91c2fa66b3a81e5143819dd9d774fa1c116
Reviewed-on: https://skia-review.googlesource.com/23140
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-07-13 15:15:54 +00:00
Ethan Nicholas
68990be759 Re-land of "converted GrSimpleTextureEffect to sksl"
This reverts commit baf981f716.

Bug: skia:
Change-Id: I36f6bfb616f1ec2b89043e3a6f7cbdf473bc9588
Reviewed-on: https://skia-review.googlesource.com/22369
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-13 14:07:02 +00:00
Mike Reed
304a07c6c9 remove references to kIndex_8_SkColorType from our tools/tests
Bug: skia:6828
Change-Id: Ib5049c28c11b7320bece20f5a0a886de8b2a4343
Reviewed-on: https://skia-review.googlesource.com/22728
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-12 20:25:44 +00:00
Yuqian Li
7da6ba2d63 Implement Sk4i's abs, min, max
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Bug: skia:
Change-Id: Ia9ec3f72095e1c744f88df7bb990d99e0f87d578
Reviewed-on: https://skia-review.googlesource.com/22720
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-07-12 20:20:43 +00:00
Mike Reed
6409f84fc3 Revert "Revert "Change image encode api to return sk_sp""
This reverts commit 64778d9f27.

Bug: skia:
Change-Id: I779515ff1e16a40c33890a4bac7a8a07171aadfe
Reviewed-on: https://skia-review.googlesource.com/22261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-12 15:44:35 +00:00
Ethan Nicholas
baf981f716 Revert "converted GrSimpleTextureEffect to sksl"
This reverts commit 46b654df9e.

Reason for revert: making Vulkan mad

Original change's description:
> converted GrSimpleTextureEffect to sksl
> 
> Bug: skia:
> Change-Id: If556c6baad75f22135f429759feabaaec095b900
> Reviewed-on: https://skia-review.googlesource.com/21720
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,ethannicholas@google.com

Change-Id: I06fac3d106435e1d58e19cc54a919c5d84784d92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/22266
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-12 13:51:46 +00:00
Ethan Nicholas
46b654df9e converted GrSimpleTextureEffect to sksl
Bug: skia:
Change-Id: If556c6baad75f22135f429759feabaaec095b900
Reviewed-on: https://skia-review.googlesource.com/21720
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-12 13:28:25 +00:00
Mike Reed
7e49d534d7 check for null surface in test
If the bounds of the blob are empty, we will request a zero-sized surface
which will fail. Just check for that.

Only expect this if the typeface is empty (e.g. faked out for testing)

Bug: skia:
Change-Id: Idcac0e9d4e2a5fe68926a33250015609b5c7e365
Reviewed-on: https://skia-review.googlesource.com/22360
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-11 19:45:04 +00:00
Leon Scroggins
571b30f611 Reland "Remove support for decoding to kIndex_8"
Original change's description:
> > Remove support for decoding to kIndex_8
> > 
> > Fix up callsites, and remove tests that no longer make sense.
> > 
> > Bug: skia:6828
> > Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295
> > Reviewed-on: https://skia-review.googlesource.com/21664
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
> 
> TBR=djsollen@google.com,scroggo@google.com
> 
> Change-Id: I1bc669441f250690884e75a9a61427fdf75c6907
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6828
> Reviewed-on: https://skia-review.googlesource.com/22120
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com

Bug: skia:6828
Change-Id: I36ff5a11c529d29e8adc95f43b8edc6fd1dbf5b8
Reviewed-on: https://skia-review.googlesource.com/22320
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-07-11 18:00:31 +00:00
Mike Reed
f778eb2f51 check for default typeface for new test
Bug: skia:
Change-Id: I5e52b3259acf73875640ec172d4ff8030975b611
Reviewed-on: https://skia-review.googlesource.com/22262
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-11 16:49:21 +00:00
Mike Reed
64778d9f27 Revert "Change image encode api to return sk_sp"
This reverts commit dc799550e2.

Reason for revert: need to fix sites in Document_none

Original change's description:
> Change image encode api to return sk_sp
> 
> Bug: skia:
> Change-Id: I238289bc630be27795cb1384955dd6e887597c05
> Reviewed-on: https://skia-review.googlesource.com/22208
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=scroggo@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Id7f67027e5f1405a60fdbde29863cdf8daef0cb7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/22280
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-11 16:00:32 +00:00
Mike Reed
dc799550e2 Change image encode api to return sk_sp
Bug: skia:
Change-Id: I238289bc630be27795cb1384955dd6e887597c05
Reviewed-on: https://skia-review.googlesource.com/22208
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-07-11 15:43:21 +00:00
Mike Reed
b99beddc7a Add serialize + catalog api to SkTextBlob
Bug: skia:6836
Change-Id: I858cf936b015c14f12a41a4912e19bb15de8abaa
Reviewed-on: https://skia-review.googlesource.com/21730
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-07-11 14:49:31 +00:00
Ethan Nicholas
ceb4d48ef4 Re-land "converted GrCircleBlurFragmentProcessor to sksl"
This reverts commit 818ac5a00d.

Bug: skia:
Change-Id: I9bd8a06bd2dbb40bd261d64d6d04daf864bc00a5
Reviewed-on: https://skia-review.googlesource.com/22075
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-11 13:50:51 +00:00
Robert Phillips
8e8c755f56 Move GrResourceProvider::createMipMappedTexture to GrSurfaceProxy::MakeDeferredMipMap
Although this adds a new method to GrResourceProvider, it is a slight improvement in that it removes some GrProxy stuff from GrResourceProvider (which arguably should only deal in GrSurface-derived classes).

Bug: skia:
Change-Id: I6d097ed178cd2aa5662770a164135bf2553b80e6
Reviewed-on: https://skia-review.googlesource.com/22023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-07-11 13:23:41 +00:00
Leon Scroggins
8321f7585b Revert "Remove support for decoding to kIndex_8"
This reverts commit 742a3e298f.

Reason for revert: Breaking Android roll:
frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:453:18: error: no member named 'fColorPtr' in 'SkAndroidCodec::AndroidOptions'
    codecOptions.fColorPtr = colorPtr;
    ~~~~~~~~~~~~ ^
frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:454:18: error: no member named 'fColorCount' in 'SkAndroidCodec::AndroidOptions'
    codecOptions.fColorCount = colorCount;
    ~~~~~~~~~~~~ ^

Original change's description:
> Remove support for decoding to kIndex_8
> 
> Fix up callsites, and remove tests that no longer make sense.
> 
> Bug: skia:6828
> Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295
> Reviewed-on: https://skia-review.googlesource.com/21664
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com

Change-Id: I1bc669441f250690884e75a9a61427fdf75c6907
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6828
Reviewed-on: https://skia-review.googlesource.com/22120
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-07-10 19:51:59 +00:00
Brian Osman
9f772a44fe Skip GLPrograms test on D3D9 ANGLE to avoid NaN literals bug
Bug: skia:6842
Change-Id: I0bf58f2a00de66cae161561fc87e7adaac651e4f
Reviewed-on: https://skia-review.googlesource.com/22064
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-07-10 17:27:29 +00:00
Hal Canary
a8565e502d ICC: SkICCGetColorProfileTag supports special cases
Special cases:
  - "sRGB"
  - "AdobeRGB"
  - "DCI-P3"
  - "Linear Transfer with sRGB Gamut"
  - "2.2 Transfer with sRGB Gamut"
  - "sRGB Transfer with DCI-P3 Gamut"
  - "Linear Transfer with DCI-P3 Gamut"
  - "sRGB Transfer with Rec-BT-2020 Gamut"
  - "Linear Transfer with Rec-BT-2020 Gamut"

tools/colorspaceinfo now prints out the Tag.

Also: constants representing gSRGB_TransferFn, g2Dot2_TransferFn, and
gLinear_TransferFn, gDCIP3_TransferFn.

BUG=skia:6720
Change-Id: I92a3f9db9d744d3ec366e4e59afd759ba043c235
Reviewed-on: https://skia-review.googlesource.com/20225
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-07-10 17:08:28 +00:00
Leon Scroggins III
742a3e298f Remove support for decoding to kIndex_8
Fix up callsites, and remove tests that no longer make sense.

Bug: skia:6828
Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295
Reviewed-on: https://skia-review.googlesource.com/21664
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-07-10 17:06:48 +00:00
Ethan Nicholas
818ac5a00d Revert "converted GrCircleBlurFragmentProcessor to sksl"
This reverts commit 9b80ffc77b.

Reason for revert: breaking ANGLE and Android Vulkan GMs

Original change's description:
> converted GrCircleBlurFragmentProcessor to sksl
> 
> Bug: skia:
> Change-Id: I1b70ba2003c9e9de2b5b9acadaf25c9ed59b1198
> Reviewed-on: https://skia-review.googlesource.com/21727
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Ia313013b4354b34fa5a02bdb16d007a462c5ca94
Reviewed-on: https://skia-review.googlesource.com/22028
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-10 13:35:25 +00:00
Brian Salomon
8fe24272fa Add mock config to tools and run through gms and benchs without crashing.
Change-Id: I7e2474129ef2b15899ad2baeb8d18f39d05da98c
Reviewed-on: https://skia-review.googlesource.com/21820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-07 20:47:38 +00:00
Ethan Nicholas
9b80ffc77b converted GrCircleBlurFragmentProcessor to sksl
Bug: skia:
Change-Id: I1b70ba2003c9e9de2b5b9acadaf25c9ed59b1198
Reviewed-on: https://skia-review.googlesource.com/21727
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-07 20:42:34 +00:00
Brian Osman
f4d57d633f Tweak GLPrograms random seed to "fix" ANGLE bots
See anglebug.com/2098

No-Tree-Checks: true

Change-Id: I793459f57a75ccefc7f071ef506e9d128c5abbe4
Reviewed-on: https://skia-review.googlesource.com/21860
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-07 16:47:48 +00:00
Mike Reed
98308fb081 Plumb through need for unpremul/premul
Update unittest to build test image with legal premul pixels.

Bug: skia:
Change-Id: Iebd1d2f81cac77f8913bd79f6ac25983ed710641
Reviewed-on: https://skia-review.googlesource.com/21735
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-07 13:19:57 +00:00
Florin Malita
39e085559d Add an SkColorSpaceXformer image filter cache
The cache is scoped with the SkColorSpaceXformer object.

This ensures we're not transforming nodes with a degree > 1 multiple
times, and preserves the DAG topology.

Change-Id: I0b072cdac95f9f1c34e0565ed4f258aba986e1ae
Reviewed-on: https://skia-review.googlesource.com/21726
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-07-06 18:59:36 +00:00
Mike Reed
c91e3877a5 add stages for black and white colors
histogram of test skps:

black: 1/7
white: 2/7
other: 4/7

Bug: skia:
Change-Id: I3a092899d31ce87837e66e5c8ea9ec5e0f239361
Reviewed-on: https://skia-review.googlesource.com/21408
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-06 17:37:47 +00:00
Florin Malita
08252eca36 Image filter DAG test for makeColorSpace()
Change-Id: I8aa3a8c701fdfe215cae639bc9c7082340c756d4
Reviewed-on: https://skia-review.googlesource.com/21721
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-07-06 17:20:06 +00:00
Leon Scroggins III
674a1848ae Add SkCodec::Result indicating error in the data
Previously, SkGifCodec treated an error in the LZW data as incomplete,
since we can still draw the partially decoded image. But a client doing
incremental decodes needs to distinguish this from truly incomplete
data. In the case of an error, the client should not attempt to provide
more data and decode again.

Add kErrorInInput, and return it when SkGifCodec sees a fatal error.
Treat it the same as kIncompleteInput when it comes to filling and DM.

Bug: skia:6825
Change-Id: Ic6ce3a62c0b065ed34dcd8006309e43272a3db9f
Reviewed-on: https://skia-review.googlesource.com/21530
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
2017-07-06 16:49:36 +00:00
Brian Salomon
0c26a9dbd0 GR_TEST_UTILS fixes
Fixes build of Skia lib when GR_TEST_UTILS=0

Makes GR_TEST_UTILS=0 for official builds

Makes "Mini" builder bot exercise building GPU with is_official_build=true

Bug: skia:6786
Change-Id: I6186683a3a216d2e779645bd9e8276a66bcff4d5
Reviewed-on: https://skia-review.googlesource.com/21524
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-07-06 14:35:45 +00:00
Brian Salomon
8996e18358 Use RGBA rather than N32 for GPU tests
This is to support a Mock backend that passes non-rendering context unit tests and has minimal config support.

Change-Id: I57c3ad2d347659d14382a8a7cf53424633bd86c6
Reviewed-on: https://skia-review.googlesource.com/21534
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-05 21:27:15 +00:00
Ethan Nicholas
9fb036fb13 rewrote GrAlphaThresholdFragmentProcessor in sksl
Bug: skia:
Change-Id: I641b206fc3bc19ac190ad94ee755ab9e1caab9b3
Reviewed-on: https://skia-review.googlesource.com/21341
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-07-05 21:02:39 +00:00
Mike Reed
412cda7379 add srgb gamma colorfilters
... faster and more accurate than using SkTableColorFilter

todo: update blink after this lands

Bug:737981
Change-Id: I55b5c60dd23b9d2cbe9d60f83c74be1a8f3dcfcf
Reviewed-on: https://skia-review.googlesource.com/21368
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-07-05 20:16:27 +00:00
Mike Reed
a920d367bf remove unneeded code for index8 imagse
Bug: skia:6828
Change-Id: I039d6bc35a1ed93ce747247f32fe4e9d5b09da0c
Reviewed-on: https://skia-review.googlesource.com/21400
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-03 19:07:25 +00:00
Mike Reed
0401c0d1d3 hide index8 support
Bug: skia:
Change-Id: I4ab7f4665cc9992319d3c9a5e02a417d503c189e
Reviewed-on: https://skia-review.googlesource.com/20121
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-03 13:58:18 +00:00
Mike Klein
9f183505ac clean up GCC 6.3 workaround
This is all kind of silly... this is just a little bit of code that's
not really reachable, but there to satisfy compilers that can't figure
that out.

Change-Id: Ib39e8bf0fd26e28541cfad37c7ea135a30dbe85a
Reviewed-on: https://skia-review.googlesource.com/21365
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-30 16:54:24 +00:00
Robert Phillips
1c9686bfa5 Speculative "fix" for crash in analyzeProcessors
From the bug it looks like a null fragment processors may be getting into the processor set. This CL tries to plug any gaps in our fragmentProcessor handling.

The only real substantive part to this CL is the addition of some "if (!fp) { return nullptr; }" blocks.

Everything else is just to add chokepoints for processor allocation.

Bug: 734076
Change-Id: I4952b1a05bc6690d5aa09de977fa6dc54c80338a
Reviewed-on: https://skia-review.googlesource.com/21267
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-30 15:29:50 +00:00
Mike Reed
9c1d780228 remove filterSpan from SkColorFilter
Bug: skia:
Change-Id: Ie8a31ea8131c08d251a825622484342e3e174474
Reviewed-on: https://skia-review.googlesource.com/21207
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-06-29 16:09:37 +00:00
xidachen
185a3798db Fix memory leak in SkImageFilter
In our current implementation of SkImageFilterCache, when the
removeInternal() function is called, the Value is removed, but their
corresponding keys are not always removed in SkImageFilter. That could
result in memory leak.

In this CL, we made changes such that the Value structure now keeps
a pointer to the SkImageFilter. Each time when the removeInternal()
is called, we ask the SkImageFilter to remove the associated keys.

Bug: 689740
Change-Id: I0807fa3581881ad1530536df5289e3976792281f
Reviewed-on: https://skia-review.googlesource.com/20960
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-06-29 15:51:17 +00:00
Ethan Nicholas
762466e9fe Re-re-land sksl fragment processor support
This reverts commit 5ce3972055.

Bug: skia:
Change-Id: I88260c90004610a1cf8ad1a87c2b4b222525bbb6
Reviewed-on: https://skia-review.googlesource.com/21108
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-29 14:57:47 +00:00
Mike Reed
44d04bd7ed add null-surface
Bug:crbug.com/737726
Change-Id: Iec9094d8d7232943e90fe2d9745fc83bcdf90954
Reviewed-on: https://skia-review.googlesource.com/21190
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-29 12:14:53 +00:00
Robert Phillips
806be2d501 Improve handling of clip stack ID
Change-Id: I1d5cf06d9b50c370f969a8778181fe94f7d35844
Reviewed-on: https://skia-review.googlesource.com/21061
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-28 21:20:32 +00:00
Mike Klein
c2d207603e clean up low-hanging swap_rb
There are two remaining swap_rb uses that both look non-trivial to
replace:
   - sampling out of index8 when the color table is bgra
   - table transforms on bgra inputs in SkColorSpaceXform

I don't think it's a big deal to just leave swap_rb around,
just a little sad.

Change-Id: I3d30200cf867cbf37d6f86572b1574d3e22e3490
Reviewed-on: https://skia-review.googlesource.com/21040
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-28 17:41:56 +00:00
Eric Boren
746e2632c6 Move all Linux GCE bots to Debian
NOTREECHECKS:true
Bug: skia:
Change-Id: I612989c6ce2f309d2f70f896500f73e4baa971a7
Reviewed-on: https://skia-review.googlesource.com/19811
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-06-28 12:38:28 +00:00
Mike Klein
5ce3972055 Revert "Re-land sksl fragment processor support"
This reverts commit c070939fd1.

Reason for revert: 

This has some knock-on effects in the generation of Android.bp from our GN files.  See gn/gn_to_bp.py?  We're seeing things like "tmp/tmpsBVycx/gen/" end up in the include search path in Android.bp, which obviously don't exist there...

Original change's description:
> Re-land sksl fragment processor support
> 
> This reverts commit ed50200682.
> 
> Bug: skia:
> Change-Id: I9caa7454b391450620d6989dc472abb3cf7a2cab
> Reviewed-on: https://skia-review.googlesource.com/20965
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=benjaminwagner@google.com,ethannicholas@google.com

Change-Id: I502486b5405923b322429219f4cc396a45a14cea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20990
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-06-27 22:52:10 +00:00
Mike Klein
9f2b3d1fbf remove unused "swap" stage
Change-Id: I25619f010f8ac6441529cfe8dff2d8c42d7400cf
Reviewed-on: https://skia-review.googlesource.com/20988
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-27 21:50:53 +00:00
Ethan Nicholas
c070939fd1 Re-land sksl fragment processor support
This reverts commit ed50200682.

Bug: skia:
Change-Id: I9caa7454b391450620d6989dc472abb3cf7a2cab
Reviewed-on: https://skia-review.googlesource.com/20965
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-27 18:27:57 +00:00
Jim Van Verth
52fb02edf2 Fix TransferBufferTest for TegraX1
Bug: skia:
Change-Id: Ia64f48581e8003baec2eeaa4821354350b3333f4
Reviewed-on: https://skia-review.googlesource.com/20504
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-27 15:42:25 +00:00
Ethan Nicholas
ed50200682 Revert "sksl fragment processor support"
This reverts commit ccf59917d3.

Reason for revert: breaking iOS bots

Original change's description:
> sksl fragment processor support
> 
> Bug: skia:
> Change-Id: Ia3b0305c2b0c78074303831f628fb01852b90d34
> Reviewed-on: https://skia-review.googlesource.com/17843
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,benjaminwagner@google.com,ethannicholas@google.com

Change-Id: I0a33060c7c42c7b44c5c13d443ac42958291c2f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20962
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-27 14:36:44 +00:00
Ethan Nicholas
ccf59917d3 sksl fragment processor support
Bug: skia:
Change-Id: Ia3b0305c2b0c78074303831f628fb01852b90d34
Reviewed-on: https://skia-review.googlesource.com/17843
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-06-27 14:20:05 +00:00
Robert Phillips
8744405448 Remove SkImage_Base::peekTexture call
Change-Id: Ie5b6bec8df083e0a128aa234d80f5a214cd98f0d
Reviewed-on: https://skia-review.googlesource.com/20741
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-26 15:29:18 +00:00
Mike Reed
fb49909aca Revert "Remove deadcode for sRGB image shading."
This reverts commit 51f6a0f89e.

Reason for revert: try to fix chrome roll

Original change's description:
> Remove deadcode for sRGB image shading.
> 
> Change-Id: I9d98da67d97b64ab55cf44b9ae447882dccda1ca
> Reviewed-on: https://skia-review.googlesource.com/20695
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I90409a08409177d9dc3b094d736af0fdaf7d6cdd
Reviewed-on: https://skia-review.googlesource.com/20824
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-26 13:59:51 +00:00
Mike Reed
5e78c61075 Revert "remove a bit more dead code"
This reverts commit d9b1fe02a6.

Reason for revert: try to fix chrome roll

Original change's description:
> remove a bit more dead code
> 
> Change-Id: I61484672e88d6bb4f75833ee89e7178c4f34d610
> Reviewed-on: https://skia-review.googlesource.com/20780
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I03dcd344dfb138261d9421b0692d12e4ed431100
Reviewed-on: https://skia-review.googlesource.com/20822
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-26 13:53:22 +00:00
Mike Reed
91d7d1d4ac Revert "Revert "Remove deadcode for sRGB image shading.""
This reverts commit e08e639063.

Reason for revert: revert was not clean

Original change's description:
> Revert "Remove deadcode for sRGB image shading."
> 
> This reverts commit 51f6a0f89e.
> 
> Reason for revert: crazy attempt to fix chrome roll
> 
> Original change's description:
> > Remove deadcode for sRGB image shading.
> > 
> > Change-Id: I9d98da67d97b64ab55cf44b9ae447882dccda1ca
> > Reviewed-on: https://skia-review.googlesource.com/20695
> > Reviewed-by: Mike Klein <mtklein@chromium.org>
> > Commit-Queue: Herb Derby <herb@google.com>
> 
> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: Icab02936d6c18e50b8de353aa1cd4c225e15e0bf
> Reviewed-on: https://skia-review.googlesource.com/20800
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com

Change-Id: Ibc579a5a95e78cb257e8d443dbb905db3761e84a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/20802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-25 20:01:28 +00:00
Mike Reed
e08e639063 Revert "Remove deadcode for sRGB image shading."
This reverts commit 51f6a0f89e.

Reason for revert: crazy attempt to fix chrome roll

Original change's description:
> Remove deadcode for sRGB image shading.
> 
> Change-Id: I9d98da67d97b64ab55cf44b9ae447882dccda1ca
> Reviewed-on: https://skia-review.googlesource.com/20695
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Icab02936d6c18e50b8de353aa1cd4c225e15e0bf
Reviewed-on: https://skia-review.googlesource.com/20800
Reviewed-by: Mike Reed <reed@google.com>
2017-06-25 19:55:03 +00:00
Mike Klein
d9b1fe02a6 remove a bit more dead code
Change-Id: I61484672e88d6bb4f75833ee89e7178c4f34d610
Reviewed-on: https://skia-review.googlesource.com/20780
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-06-24 16:08:23 +00:00
Herb Derby
51f6a0f89e Remove deadcode for sRGB image shading.
Change-Id: I9d98da67d97b64ab55cf44b9ae447882dccda1ca
Reviewed-on: https://skia-review.googlesource.com/20695
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-06-23 21:21:59 +00:00
Robert Phillips
81dd3e0c66 Finish a few MDB TODOs
Change-Id: I5579bea381ce30dc59502dbeb5841fea927002c2
Reviewed-on: https://skia-review.googlesource.com/20640
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-23 18:53:56 +00:00
Brian Salomon
ae38f6e8f3 skbug5221 unit test should not require N32 support from GPU
Change-Id: I98f0120a012f0adaf0b34d11135a1210a66ecea0
Reviewed-on: https://skia-review.googlesource.com/20681
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-23 16:30:55 +00:00
Brian Salomon
91a3e52552 Move mock gpu and caps, add Gr prefix, and create via GrContext::Create
Change-Id: I02427839f78372e337ed717b071c6baaa8ba4450
Reviewed-on: https://skia-review.googlesource.com/20622
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-23 15:42:15 +00:00
Jim Van Verth
915893167e Remove static initializer restriction for Vulkan tests
Change-Id: I277110976844fc80271f4e86bb8474047e8abd2a
Reviewed-on: https://skia-review.googlesource.com/20510
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-22 18:12:30 +00:00
Jim Van Verth
2e5eaf022e Revert "Revert "Clean up onTransferPixels""
Bug: skia:5126
Change-Id: Ia1eaef56cca266ad4c413e711e63646e913222be
Reviewed-on: https://skia-review.googlesource.com/20445
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-22 13:14:01 +00:00
Hal Canary
f975b3eb65 Revert "Revert "SkRegion: more robust validation""
This reverts commit 7f4124058e.

Original change's description:
> Revert "SkRegion: more robust validation"
> 
> This reverts commit 711450e948.
> 
> Reason for revert: speculative revert to fix chrome roll.
> 
> Original change's description:
> > SkRegion: more robust validation
> > 
> > BUG=oss-fuzz:1864
> > Change-Id: I4c3d3c4c7b0717399fe16f227e032682b13ebc74
> > Reviewed-on: https://skia-review.googlesource.com/20322
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Hal Canary <halcanary@google.com>

TBR=halcanary@google.com,caryclark@google.com,reed@google.com

Change-Id: I1e5500cb83adeeda544282577ce55812e1b5d682
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:1864
Reviewed-on: https://skia-review.googlesource.com/20501
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-06-22 11:22:11 +00:00
Chris Dalton
832bd2b697 Add a concat method to SkTInternalLList
Bug: skia:
Change-Id: I3d62aff691f6cc08b7995bd72dbfd6289c803c6a
Reviewed-on: https://skia-review.googlesource.com/20380
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-21 22:19:16 +00:00
Brian Osman
ceb7a42649 Fix cross context test to actually use shared GL contexts
It's incredible that this was working on so many devices and GL implementations.

Bug: skia:
Change-Id: I8d43405b1eaea170e28840f17a7088d2f59aa612
Reviewed-on: https://skia-review.googlesource.com/20449
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-21 20:04:50 +00:00
Hal Canary
7f4124058e Revert "SkRegion: more robust validation"
This reverts commit 711450e948.

Reason for revert: speculative revert to fix chrome roll.

Original change's description:
> SkRegion: more robust validation
> 
> BUG=oss-fuzz:1864
> Change-Id: I4c3d3c4c7b0717399fe16f227e032682b13ebc74
> Reviewed-on: https://skia-review.googlesource.com/20322
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=halcanary@google.com,caryclark@google.com,reed@google.com

Change-Id: I95cbbf064db6ea7ef74a757bca058ba8de20d87b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:1864
Reviewed-on: https://skia-review.googlesource.com/20452
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-06-21 19:57:21 +00:00
Hal Canary
711450e948 SkRegion: more robust validation
BUG=oss-fuzz:1864
Change-Id: I4c3d3c4c7b0717399fe16f227e032682b13ebc74
Reviewed-on: https://skia-review.googlesource.com/20322
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-06-21 16:59:03 +00:00
Ethan Nicholas
7da6dfabc4 implemented mustImplementGSInvocationsWithLoop workaround in sksl
Third time's the charm

This reverts commit 84cda40bd7.

Bug: skia:
Change-Id: I2c0f4425122a94beb7b4053ee6e891faa8a5f290
Reviewed-on: https://skia-review.googlesource.com/20441
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-21 15:55:06 +00:00
Jim Van Verth
ce57552e11 Revert "Clean up onTransferPixels"
This reverts commit f7037d003c.

Reason for revert: Issues on test bots.

Original change's description:
> Clean up onTransferPixels
> 
> Bug: skia:5126
> Change-Id: I323c50e7854744302007b4ae7bd25e5742c14cbc
> Reviewed-on: https://skia-review.googlesource.com/19055
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: I923fda4d5cd8c2896fb347f9b2695b7f83d9137b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:5126
Reviewed-on: https://skia-review.googlesource.com/20444
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-21 15:50:51 +00:00
Jim Van Verth
f7037d003c Clean up onTransferPixels
Bug: skia:5126
Change-Id: I323c50e7854744302007b4ae7bd25e5742c14cbc
Reviewed-on: https://skia-review.googlesource.com/19055
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-21 15:28:50 +00:00
Mike Reed
84cda40bd7 Revert "Revert "Revert "implemented mustImplementGSInvocationsWithLoop workaround in sksl"""
This reverts commit f66d28dfb2.

Reason for revert: breaks chrome-roll?
https://chromium-review.googlesource.com/c/542000

Original change's description:
> Revert "Revert "implemented mustImplementGSInvocationsWithLoop workaround in sksl""
> 
> This reverts commit 8ea60736aa.
> 
> Bug: skia:
> Change-Id: If77035e03430b469c2682788610b33ae0aefbe1f
> Reviewed-on: https://skia-review.googlesource.com/20053
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=csmartdalton@google.com,ethannicholas@google.com

Change-Id: Iedada4e4b9facb37b792a655947d76eb0f7b22e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-21 03:34:49 +00:00
Ethan Nicholas
f66d28dfb2 Revert "Revert "implemented mustImplementGSInvocationsWithLoop workaround in sksl""
This reverts commit 8ea60736aa.

Bug: skia:
Change-Id: If77035e03430b469c2682788610b33ae0aefbe1f
Reviewed-on: https://skia-review.googlesource.com/20053
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-20 20:51:15 +00:00
Brian Osman
e53120754b Add SkCopyPixelsMode argument to SkMakeImageInColorSpace
Deferred rendering in Android will need the ability to use this in
kIfMutable mode.

Bug: skia:
Change-Id: I5194f2c50f9d17351fdab49373ca9bc1e80cf586
Reviewed-on: https://skia-review.googlesource.com/20157
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-06-20 14:03:01 +00:00
Greg Daniel
78325c1d01 Restrict max levels for D3D Angle on GLPrograms test as well
BUG=skia:4717

Change-Id: I6111af2526042296c510318520c96c0ce5efc214
Reviewed-on: https://skia-review.googlesource.com/20284
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-19 21:03:34 +00:00
Greg Daniel
d895ca673d Limit number of stages for Angle D3D for GLPrograms test
Bug: skia:4717
Change-Id: I5ea613311d2c346bc45875040665a121b455f674
Reviewed-on: https://skia-review.googlesource.com/20228
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-19 19:08:04 +00:00
Mike Reed
0bdaf05fc1 remove unused mode parameter from SkMergeImageFilter
Bug: skia:
Change-Id: Iaa46aaef130a337987c3528685f59c56387d4a7d
Reviewed-on: https://skia-review.googlesource.com/20210
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-06-19 14:01:56 +00:00
Hal Canary
7a808d618e ICC: SkICC::WriteToICC Description Tag is function of input
BUG=skia:6720
Change-Id: I038079a6e15f884eb77b84d9c7c75f6b7fbedd37
Reviewed-on: https://skia-review.googlesource.com/20152
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-06-16 21:30:37 +00:00
Brian Salomon
f86d37be5b Rename GrDrawOp::xpRequiresDstTexture to finalize and change return type to an enum
Bug: skia:
Change-Id: I0f9d9d3ef1dd20821f171f7d6237491921fbbd97
Reviewed-on: https://skia-review.googlesource.com/20142
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-16 14:24:34 +00:00
Greg Daniel
a5cb781c17 Revert "Revert "Add API for flushing surfaces with gpu semaphores""
This reverts commit 7292231905.

This change relands the original plus the follow on change:
https://skia-review.googlesource.com/20059.

Additionally it adds a blacklist for the mac intel bots which
don't see to respect the added fences on the GPU.

Original change's description:
> Revert "Add API for flushing surfaces with gpu semaphores"
> 
> This reverts commit 66366c6978.
> 
> Reason for revert: Failing test on mac bots
> 
> Original change's description:
> > Add API for flushing surfaces with gpu semaphores
> > 
> > BUG=skia:
> > 
> > Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> > Reviewed-on: https://skia-review.googlesource.com/11488
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Forrest Reiling <freiling@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com
> 
> Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/20063
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I4dc6c0e1deb0398eeb165a34f0a26af7a58259f1
Reviewed-on: https://skia-review.googlesource.com/20141
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-16 14:22:34 +00:00
Brian Salomon
610842af9e Make SkTArray maintain reserve count
Bug: skia:6690
Change-Id: I01f5bb56c654f513365d6ce9f19712d9be07a08d
Reviewed-on: https://skia-review.googlesource.com/20055
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2017-06-16 12:17:19 +00:00
Greg Daniel
7292231905 Revert "Add API for flushing surfaces with gpu semaphores"
This reverts commit 66366c6978.

Reason for revert: Failing test on mac bots

Original change's description:
> Add API for flushing surfaces with gpu semaphores
> 
> BUG=skia:
> 
> Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> Reviewed-on: https://skia-review.googlesource.com/11488
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Forrest Reiling <freiling@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20063
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-15 21:55:03 +00:00
Greg Daniel
625ac3e8f9 Revert "Add caps check for fence sync in SurfaceSemaphoreTest"
This reverts commit 643fcfa02f.

Reason for revert: Need to revert change this landed on top of

Original change's description:
> Add caps check for fence sync in SurfaceSemaphoreTest
> 
> Bug: skia:
> Change-Id: I2a941cdb2ae108728eb01f89f8ebed6b79a2df68
> Reviewed-on: https://skia-review.googlesource.com/20059
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,rmistry@google.com,brianosman@google.com

Change-Id: Ie45ee86cff6c3d23f7ef82c16c1a8d99994add10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20062
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-15 21:49:59 +00:00
Ben Wagner
453888f1c3 Improve computeMatrices singular matrix handling.
The existing singular matrix detection in computeMatrices is sufficient
but not necessary. Since compute matrices is already doing a QR
decomposition, use that to determine singularity instead. This is both
faster and more accurate than the previous method for the common case.

BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1305085

Change-Id: Iccef8368527b45e4eb565eddbebbbcf41ca66a2c
Reviewed-on: https://skia-review.googlesource.com/20054
Reviewed-by: Lee Salzman <lsalzman@mozilla.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-06-15 21:37:51 +00:00
Greg Daniel
643fcfa02f Add caps check for fence sync in SurfaceSemaphoreTest
Bug: skia:
Change-Id: I2a941cdb2ae108728eb01f89f8ebed6b79a2df68
Reviewed-on: https://skia-review.googlesource.com/20059
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-15 21:01:30 +00:00
Greg Daniel
66366c6978 Add API for flushing surfaces with gpu semaphores
BUG=skia:

Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
Reviewed-on: https://skia-review.googlesource.com/11488
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Forrest Reiling <freiling@google.com>
2017-06-15 19:49:18 +00:00
Greg Daniel
8ea60736aa Revert "implemented mustImplementGSInvocationsWithLoop workaround in sksl"
This reverts commit d5d323f457.

Reason for revert: Looks like this might be breaking vulkan

Original change's description:
> implemented mustImplementGSInvocationsWithLoop workaround in sksl
> 
> Bug: skia:
> Change-Id: I8434be89537a8baf9e9c5c7a643d28c03108f4ea
> Reviewed-on: https://skia-review.googlesource.com/18154
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=csmartdalton@google.com,ethannicholas@google.com

Change-Id: I606aad071d3c084eb7eb7ec6c1c1a3cf10479cec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20045
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-15 18:30:29 +00:00
Brian Osman
bcf65edf2c Bail out of test if MSAA surface creation fails
Bug: skia:
Change-Id: I44768314fad49fb0e094e30037a3fe159ebcbd0b
Reviewed-on: https://skia-review.googlesource.com/20044
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-15 18:29:56 +00:00
Robert Phillips
009e9af554 Remove GrGpu.h from GrResourceProvider.h
Noticed this while cleaning up GrResourceProvider.h's usage. It seems like a powerful header to just be splashing around.

Change-Id: I686fea61354a7e3c1c759627ffe4a560f7945f83
Reviewed-on: https://skia-review.googlesource.com/20040
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-15 18:27:28 +00:00
Ethan Nicholas
d5d323f457 implemented mustImplementGSInvocationsWithLoop workaround in sksl
Bug: skia:
Change-Id: I8434be89537a8baf9e9c5c7a643d28c03108f4ea
Reviewed-on: https://skia-review.googlesource.com/18154
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-15 18:06:58 +00:00
Brian Osman
eee3c09e96 Unit test to demonstrate Galaxy S6 MSAA readPixels bug
After lots of tinkering, this is the smallest test case I've
found to reproduce the bug. Frequently, bitmap b4 will be
cleared to blue, but not contain the oval drawn right before.
Bitmap b5 will contain the oval, so the diff of the two
bitmaps will detect the error.

There may be something else that can be removed, but I
haven't found it.

Interesting note:

In the original version, all surfaces were cleared to
black. When I started trying to change the clear colors to
figure out if we were getting an old surface, the bug went
away. In particular, the first clear color is irrelevant,
but the last three clears must all be the same color. If
any are different, the bug doesn't occur.

Bug: skia:6653
Change-Id: Iacafcc140b60594fab208e82987b0f37416975f3
Reviewed-on: https://skia-review.googlesource.com/19817
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-15 17:58:08 +00:00
Robert Phillips
fbcef6eb8a Clean up GrResourceProvider usage
The only substantive changes are the removal of GrProxy instantiation in:

SkGpuBlurUtils::GaussianBlur
GrSimpleTextureEffect::Make*

Change-Id: I10970609693bd6ff5b3a3c21b41d82642bb277bc
Reviewed-on: https://skia-review.googlesource.com/19965
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-15 17:18:19 +00:00
Brian Salomon
baaf439eb5 Revert "Revert "Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses.""
This reverts commit a0485d9452.

Bug: skia:
Change-Id: If50b2d1af285a6c3c943373bb7258b56e1af28d6
Reviewed-on: https://skia-review.googlesource.com/19961
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-15 16:49:40 +00:00
Brian Salomon
a0485d9452 Revert "Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses."
This reverts commit 1ec03f33cf.

Revert "Fix logic reversal in NonAAFillRectOp test factory"

This reverts commit 89c1c2552e.

Reason: Unexpected GM changes.

Bug: skia:
Change-Id: I9edf5f0e4a54b5cad86bd438a505aaaef38563de
Reviewed-on: https://skia-review.googlesource.com/19960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-14 23:32:05 +00:00
Brian Salomon
1ec03f33cf Converts remaining rect ops from GrLegacyMeshDrawOp to GrMeshDrawOp subclasses.
Consolidates op factory functions to a rewritten GrRectOpFactory.

Removes GrRenderTargetContext::drawNonAAFilledRect() in favor of creating and adding ops directly by the callers.

Change-Id: I57e5fc739bf4e92b4a4710c739e6d22cce82a479
Reviewed-on: https://skia-review.googlesource.com/17711
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-14 20:26:51 +00:00
Greg Daniel
d7b1159d78 Revert "Revert "Go back to using dual source blending for lcd src-over even with non-opaque color""
This reverts commit 7d6fe0b996.

Reason for revert: Relanding with fix

Original change's description:
> Revert "Go back to using dual source blending for lcd src-over even with non-opaque color"
> 
> This reverts commit b54bdef86e.
> 
> Reason for revert: breaking some bots
> Original change's description:
> > Go back to using dual source blending for lcd src-over even with non-opaque color
> > 
> > This is change is currently still safe since earlier in Skia we are still requiring
> > the dst to be opaque. The change is a workaround to spots where trying to read the
> > dst to do in shader blending is failing for some reason. This also should give back
> > a little performance since doing dual source blending should be better than shader
> > blends.
> > 
> > Bug: chromium:732341
> > Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29
> > Reviewed-on: https://skia-review.googlesource.com/19703
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ibb9bc1ef4ec5967dabcd62c81f62c0989c14fbb8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:732341
> Reviewed-on: https://skia-review.googlesource.com/19815
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com
Bug: chromium:732341

Change-Id: I7481755a9aa64364371d8149af4458fc2c15c8aa
Reviewed-on: https://skia-review.googlesource.com/19840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-14 18:40:25 +00:00
Greg Daniel
7d6fe0b996 Revert "Go back to using dual source blending for lcd src-over even with non-opaque color"
This reverts commit b54bdef86e.

Reason for revert: breaking some bots
Original change's description:
> Go back to using dual source blending for lcd src-over even with non-opaque color
> 
> This is change is currently still safe since earlier in Skia we are still requiring
> the dst to be opaque. The change is a workaround to spots where trying to read the
> dst to do in shader blending is failing for some reason. This also should give back
> a little performance since doing dual source blending should be better than shader
> blends.
> 
> Bug: chromium:732341
> Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29
> Reviewed-on: https://skia-review.googlesource.com/19703
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ibb9bc1ef4ec5967dabcd62c81f62c0989c14fbb8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:732341
Reviewed-on: https://skia-review.googlesource.com/19815
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-14 15:55:50 +00:00
Greg Daniel
b54bdef86e Go back to using dual source blending for lcd src-over even with non-opaque color
This is change is currently still safe since earlier in Skia we are still requiring
the dst to be opaque. The change is a workaround to spots where trying to read the
dst to do in shader blending is failing for some reason. This also should give back
a little performance since doing dual source blending should be better than shader
blends.

Bug: chromium:732341
Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29
Reviewed-on: https://skia-review.googlesource.com/19703
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-14 15:13:58 +00:00
Chris Dalton
3809bab7ed Add GrPrimitiveType::kLinesAdjacency
Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.

Bug: skia:
Change-Id: I3b5e68acfb20476f6c6923968f5a4ac4f73ae12d
Reviewed-on: https://skia-review.googlesource.com/19680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 18:18:23 +00:00
Robert Phillips
646e4293f0 Retract GrTexture*.h & GrRenderTarget*.h from other headers
This does push some additional work (& includes) into the .cpp files.

Change-Id: I27c847e371802270d13594dcc22aae44039990bb
Reviewed-on: https://skia-review.googlesource.com/19660
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-13 17:21:41 +00:00
Ravi Mistry
7cd974fc7d Revert "Add GrPrimitiveType::kLinesAdjacency"
This reverts commit f7eb015083.

Reason for revert: Looks like this is causing build failures:
* https://chromium-swarm.appspot.com/task?id=36baaf4d376bbf10&refresh=10
* https://chromium-swarm.appspot.com/task?id=36baad1f17e93510&refresh=10


Original change's description:
> Add GrPrimitiveType::kLinesAdjacency
> 
> Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.
> 
> Bug: skia:
> Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a
> Reviewed-on: https://skia-review.googlesource.com/19581
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com

Change-Id: I37a1c575123b357abd8b9af9eea8871fe199f44b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/19661
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-06-13 14:45:32 +00:00
Chris Dalton
f7eb015083 Add GrPrimitiveType::kLinesAdjacency
Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.

Bug: skia:
Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a
Reviewed-on: https://skia-review.googlesource.com/19581
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 14:25:21 +00:00
Leon Scroggins III
1f6af6baad Consolidate decoding frames into SkCodec
Add a new private method to SkCodec that handles Options.fFrameIndex:
- Check to ensure the index is valid
- Call onGetFrameCount to force parsing the stream
- Recursively call getPixels (it should be complete, so no need for
  incremental decoding) to decode the prior frame if necessary
- Zero fill a RestoreBGColor frame

Call the method in getPixels and startIncrementalDecode, and remove
duplicate code from GIF and WEBP.

Remove support for scaling frames beyond the first, which is currently
unused.

Preserve the feature of SkGifCodec that it will only parse to the end
of the first frame if the first frame is asked for. (Also note that
when we continue a partial frame, we won't force parsing the full
stream.) If the client only wants the first frame, parsing the rest
would be unnecessary. But if the client wants the second, we assume
they will want any remaining frames, so we parse the remainder of the
stream. This simplifies the code (so SkCodec does not have to ask its
subclass to parse up to a particular frame).

Update tests that relied on the old behavior:
- Codec_partialAnim now hardcodes the bytes needed. Previously it
  relied on the old behavior that GIF only parsed up to the frame being
  decoded.
- Codec_skipFullParse now only tests the first frame, since that is the
  case where it is important to skip a full parse.

TBR=reed@google.com
No changes to the public API.

Change-Id: Ic2f075452dfeedb4e3e60e6cf4df33ee7bd38495
Reviewed-on: https://skia-review.googlesource.com/19276
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-12 20:55:59 +00:00
Eric Karl
7a8c84c6c9 Reland DeferredTextureImageData low-bit-depth/dithering support
Cause DeferredTextureImageData functionality to support low bit depth
(4444, 565) image formats (with dithering).

Updated to handle colorspace + 4444 colortype correctly.

Bug: 720105
Change-Id: Ib7e14d937849f4f6b08fda6992a240bb203d0089
Reviewed-on: https://skia-review.googlesource.com/19094
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-12 18:27:48 +00:00
Matt Sarett
b6759dd16e Revert "Revert "Disable F16-nullptr sources""
This relands the original change with a modification.  We should
not check for non-null pixels because this breaks the Android
hw bitmap use case.

Bug: b/62482405
Change-Id: I081412bb46754d33b69e02e5754f04a082e081ae
Reviewed-on: https://skia-review.googlesource.com/19494
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-06-12 18:09:03 +00:00
Stephen White
e3a0be73a6 GrTessellator: fix two NaN issues.
If a point in the path rounds to +inf/-inf, the intersection code can
produce NaN, which is unsortable. Fix: ignore non-finite intersections.

Quadratic interpolation can sometimes produce NaN, which will never
satisfy the flatness criterion. Abort if any of the interpolated points
are non-finite.

Bug:732023
Change-Id: If5881796e589c75b8f74459f42d00918619713a2
Reviewed-on: https://skia-review.googlesource.com/19467
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-12 17:44:23 +00:00
Robert Phillips
db4062038c Re-enable deferred proxies in Chrome
Change-Id: I6dad0c1d3ff9f81e13625988b00c3f844128d7e7
Reviewed-on: https://skia-review.googlesource.com/19446
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-12 15:59:47 +00:00
Ethan Nicholas
b310fd597f fixed issue with SkSL dead code elimination
Bug: skia:6747
Change-Id: I8566f0f6822a452167079cca004730ec0db318a8
Reviewed-on: https://skia-review.googlesource.com/19275
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-12 14:32:40 +00:00
Matt Sarett
69d1469654 Revert "Disable F16-nullptr sources"
Manual revert: failing ui rendering cts tests

Bug: b/62482405
Change-Id: I652ec8dce482d303437835a27c50a22248afd955
Reviewed-on: https://skia-review.googlesource.com/19360
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-09 19:29:13 +00:00
Robert Phillips
d9d84858bf Retract GrTexture.h a bit
This began as cleaning up SkSpecialImage.h & spiraled out of control from there.

Change-Id: I9a570ecd2a7af9ee724ebfebe4e9185748f38bbc
Reviewed-on: https://skia-review.googlesource.com/19290
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-09 17:29:09 +00:00
Stephen White
019f6c0bcf GrTessellator: fix logging; fix test comment.
Change-Id: Iaded9025a1518d8c69dbe366deb1035e0bd4295b
Reviewed-on: https://skia-review.googlesource.com/19289
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-09 17:24:04 +00:00
Yuqian Li
d0dbee6559 Add comments support for PNG encoder
Bug: skia:6689
Change-Id: I6ccac8890f44724ccd6e20c8f4ea80bc99f9fa58
Reviewed-on: https://skia-review.googlesource.com/19080
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-06-09 17:24:03 +00:00
Chris Dalton
febbffad1c Improve cubic KLM accuracy
Moves cubic root finding logic out of GrPathUtils and
PathOpsCubicIntersectionTest, and unifies it in SkGeometry.

"Normalizes" the homogeneous parameter values of the roots, rather
than the cubic inflection function. Does this normalization by
twiddling the exponents instead of division (which causes a loss of
precision).

Abandons the built-in derivatives in GrCubicEffect. These don't have
high enough precision on many mobile gpus. Instead we pass the KLM
matrix to the vertex shader via uniform, where we can use it to set up
new linear functionals from which the fragment shader can calculate
the gradient of the implicit function.

Bug: skia:4410
Change-Id: Ibd64e999520adc8cdef7803a492d3699995aef5a
Reviewed-on: https://skia-review.googlesource.com/19017
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-09 17:13:54 +00:00
Robert Phillips
fee2b4ed0f Create a new HDC for each ANGLE context
Bug: skia:6711
Change-Id: I9c4720a8dbad4c6b18efe73e0e61afbdc19627bc
Reviewed-on: https://skia-review.googlesource.com/19090
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-09 00:39:00 +00:00
Robert Phillips
eb4f186779 Disable ReadPixels_Texture & ReadPixels_Gpu on ANGLE
Depends on https://skia-review.googlesource.com/c/19101/ (Store context type (rather than backend type) in ContextInfo)

Bug: skia:6742
Change-Id: I321c01838acf93ad28a17d8e97aa1bf594425502
Reviewed-on: https://skia-review.googlesource.com/19077
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-08 21:07:37 +00:00
Robert Phillips
cdabbcc3b5 Store context type (rather than backend type) in ContextInfo
Change-Id: I7dbfb735f1f094fa0a025b84f69e06a3533f2815
Reviewed-on: https://skia-review.googlesource.com/19101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-08 20:29:44 +00:00
Stephen White
0cb31675f3 GrTessellator: fix intersection above the first vertex.
Handle the case where the an intersection falls not only above both
edge endpoints, but above the first vertex in the mesh. This requires
passing the mesh into check_for_intersection(), in order to modify the
head. We also need to rewind the mesh after insertion, since we need
to rewind to the newly-inserted vertex.

This also cleans up vertex ID computation a little (for logging), so
that vertices before the first vertex or after the last have a
reasonable ID. It also cleans up the intersection-on-endpoint 
special cases by refactoring the calls to split_edge().

BUG=730687

Change-Id: Idea736eca7b7c3c5d8a470b1373a16ad8e649e80
Reviewed-on: https://skia-review.googlesource.com/19069
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-08 20:07:04 +00:00
Matt Sarett
dc79270101 Draw time color xform API for Android
Will do a lazy color xform to the dst color space at GPU upload time.

I've included the capability to control the gen id of the output
image.  This will allow us to reuse images in the Ganesh cache.
This should only be temporary.  When Android is able to cache the
actual SkImage object, we won't need to expose this anymore.

Bug: b/62347704
Change-Id: I93b950ef680f6bbdd7eb6a2ec6f50195dbb78311
Reviewed-on: https://skia-review.googlesource.com/16440
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-08 19:07:54 +00:00
Matt Sarett
d21fd4b336 Disable F16-nullptr sources
Also includes the refactor that triggered this change - stricter
checking on creation on raster SkImages.

Bug: skia:
Change-Id: Ie3216ac3f5307de4b78792b472676faa51e5459d
Reviewed-on: https://skia-review.googlesource.com/19040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-08 14:05:39 +00:00
Brian Salomon
7fbeb5acdd Revert "Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support"""
This reverts commit 840ff8837b.

Reason for revert: Not obvious to me how to fix, reverting the chrome CL that was dependent on this.

Original change's description:
> Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support""
> 
> This reverts commit d7c681d6a7.
> 
> Reason for revert: New param already used in Chrome
> 
> Original change's description:
> > Revert "DeferredTextureImageData low-bit-depth/dithering support"
> > 
> > This reverts commit 2c075e749d.
> > 
> > Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10
> > 
> > Original change's description:
> > > DeferredTextureImageData low-bit-depth/dithering support
> > > 
> > > Cause DeferredTextureImageData functionality to support low bit depth
> > > (4444, 565) image formats (with dithering).
> > > 
> > > Bug: 720105
> > > Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> > > Reviewed-on: https://skia-review.googlesource.com/18945
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Eric Karl <ericrk@chromium.org>
> > 
> > TBR=bsalomon@google.com,ericrk@chromium.org
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 720105
> > 
> > Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
> > Reviewed-on: https://skia-review.googlesource.com/19039
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 720105
> 
> Change-Id: I91e690d0564f04209a2bd677de9ae9eb9c0f90d3
> Reviewed-on: https://skia-review.googlesource.com/19041
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I63eb0051964ce99e187b4e4943ea79bc22d392d2
Reviewed-on: https://skia-review.googlesource.com/19046
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 14:02:20 +00:00
Brian Salomon
840ff8837b Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support""
This reverts commit d7c681d6a7.

Reason for revert: New param already used in Chrome

Original change's description:
> Revert "DeferredTextureImageData low-bit-depth/dithering support"
> 
> This reverts commit 2c075e749d.
> 
> Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10
> 
> Original change's description:
> > DeferredTextureImageData low-bit-depth/dithering support
> > 
> > Cause DeferredTextureImageData functionality to support low bit depth
> > (4444, 565) image formats (with dithering).
> > 
> > Bug: 720105
> > Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> > Reviewed-on: https://skia-review.googlesource.com/18945
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Eric Karl <ericrk@chromium.org>
> 
> TBR=bsalomon@google.com,ericrk@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 720105
> 
> Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
> Reviewed-on: https://skia-review.googlesource.com/19039
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I91e690d0564f04209a2bd677de9ae9eb9c0f90d3
Reviewed-on: https://skia-review.googlesource.com/19041
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 13:32:30 +00:00
Brian Salomon
d7c681d6a7 Revert "DeferredTextureImageData low-bit-depth/dithering support"
This reverts commit 2c075e749d.

Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10

Original change's description:
> DeferredTextureImageData low-bit-depth/dithering support
> 
> Cause DeferredTextureImageData functionality to support low bit depth
> (4444, 565) image formats (with dithering).
> 
> Bug: 720105
> Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> Reviewed-on: https://skia-review.googlesource.com/18945
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Eric Karl <ericrk@chromium.org>

TBR=bsalomon@google.com,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
Reviewed-on: https://skia-review.googlesource.com/19039
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 13:03:50 +00:00
Mike Reed
cde9031a5a remove unused xfermode methods
Bug: skia:
Change-Id: Ib0dfa7bbf3d4e73aab355df4d5f5e2a53f653809
Reviewed-on: https://skia-review.googlesource.com/19035
Reviewed-by: Mike Reed <reed@google.com>
2017-06-08 03:57:48 +00:00
Florin Malita
d1aeddeb8a Remove SkLinearGradient::kForce4fContext_PrivateFlag
... and related tests/gms.

We now exercise the 4f impl with raster-pipeline/burst, no need for a
special test flag.

Change-Id: If67684d2d8840b3c413db9eeebb051f59cbc5a34
Reviewed-on: https://skia-review.googlesource.com/19025
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-06-07 20:24:51 +00:00
Eric Karl
2c075e749d DeferredTextureImageData low-bit-depth/dithering support
Cause DeferredTextureImageData functionality to support low bit depth
(4444, 565) image formats (with dithering).

Bug: 720105
Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
Reviewed-on: https://skia-review.googlesource.com/18945
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
2017-06-07 20:19:46 +00:00
Leon Scroggins III
33deb7ed4d Make SkCodec more flexible about its required frame
SkCodec sets fRequiredFrame to be the earliest possible frame that a
given frame can depend on. e.g.

- Frame A fills the screen, Keep
- Frame B does not cover A, Keep
- Frame C covers B but not A, and is opaque

Frame C can depend on either A or B. SkCodec already reports that C
depends on A. This CL allows a client of SkCodec to use either A or
B to create C.

Also expose the DisposalMethod. Since any frame between A and C can
be used to create C except for DisposePrevious frames, the client
needs to be able to know the disposal method so they do not try to
use such a frame to create C.

Further, the disposal method can be used to give the client a better
idea whether they will continue to need a frame. (e.g. if frame i is
DisposePrevious and depends on i-1, the client may not want to steal
i-1 to create i, since i+1 may also depend on i-1.)

TODO: Share code for decoding prior frames between GIF and WEBP

Change-Id: I91a5ae22ba3d8dfbe0bde833fa67ae3da0d81ed6
Reviewed-on: https://skia-review.googlesource.com/13722
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-07 20:15:17 +00:00
Chris Dalton
46983b7dd8 Introduce dynamic pipeline state
Adds a DynamicState struct to GrPipeline that has a field for the
scissor rect. Eventually this should become the only way to specify a
scissor rectangle and may grow to contain more fields. Adds an array of
DynamicStates to GrGpuCommandBuffer::draw and implements support in GL
and Vulkan.

Bug: skia:
Change-Id: If5aebbf9da5d192acf7e68e7def4674ffc7ec310
Reviewed-on: https://skia-review.googlesource.com/18510
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-07 18:26:11 +00:00
Leon Scroggins III
91f0f7332f Fix alpha issues in SkGifCodec
- Call conversion_possible with the proper alpha type for the frame.
- Always use kUnpremul for the transform. Previously we used the alpha
  type for the first frame. If it was opaque and a later frame was not,
  this would be incorrect.

Also fix Codec_frames test. Most of the tests were not running due to
a return statement in a loop. Change that to continue, and correct
errors in the test. Provide better debugging information.

Change-Id: Icd40c09526b1d599168bfe90d93d8ddcdd9ca20f
Reviewed-on: https://skia-review.googlesource.com/18935
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-07 15:43:07 +00:00
Mike Reed
89c8fecb62 move SkPathRef.h into private
Bug: skia:
Change-Id: I3370c594301ae833ec1fe3cb16ac544e5b2128e8
Reviewed-on: https://skia-review.googlesource.com/18982
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-07 15:24:46 +00:00
Chris Dalton
348060fa82 Fix GrReducedClip.cpp: assertion failure surrounding tiny query bounds
Some assertions cannot be relied upon due to FP error.

Bug: skia:5990
Change-Id: I32445b320b9100ae2f80d2f762707d823da77805
Reviewed-on: https://skia-review.googlesource.com/18602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-05 19:53:06 +00:00
Leon Scroggins III
12a4dc985b Defend against ICOs with large BMPs embedded
If the ICO reports that it has a large BMP file embedded, do not
crash if we attempt to allocate too much memory.

Bug: b/38116746
Change-Id: I70eb66f5e4ffc15587007b398bbe843665eae500
Reviewed-on: https://skia-review.googlesource.com/18447
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-05 18:28:19 +00:00
Robert Phillips
67d52cf0d8 sk_sp-ify GrResourceProvider some more
I believe this addresses the concerns of this particular bug (although more remains to be done)

Bug: skia:5327
Change-Id: Ie82f08f87b3cf3d7986fe4eeb16a5d2553173913
Reviewed-on: https://skia-review.googlesource.com/18599
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 18:07:05 +00:00
Brian Salomon
28207df02b Make GrSimpleMeshDrawOpHelper record whether coverage can be implemented as alpha
This also makes the blend table entry for opaque src over indicate a blend of (1, ISA) rather than (1, 0) to match the actual implementation of the global src-over XP.
Change-Id: I1b1f64d2546e4f0cf03c0239ce674d1baad655f6
Reviewed-on: https://skia-review.googlesource.com/18521
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-05 16:47:45 +00:00
Robert Phillips
eee4d6e4e8 Make instantiate return a Boolean
From an off-line conversation:
The longer term idea will be to create a helper class isolates the
ability to instantiate proxies until flush time. The peek* methods
could then be moved to GrSurfaceProxy.

Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd
Reviewed-on: https://skia-review.googlesource.com/18076
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 14:03:10 +00:00
Mike Klein
bba02c2031 start on SkJumper lowp mode
Just 3 stages implemented so far:

  load_8888
  swap_rb
  store_8888

That's enough to make the shortest non-trivial pipeline
that you see in the new unit test.

Change-Id: Iabf90866ab452f7183d8c8dec1405ece2db695dc
Reviewed-on: https://skia-review.googlesource.com/18458
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-06-04 22:50:14 +00:00
Brian Salomon
e23bffd65b Remove support in GPU backend for distance vector field.
Also, remvoes SkNormalBevelSource as this was the last use case for the distance vector field.

Change-Id: Ib0176c78e500e6b5130310934253a75860245812
Reviewed-on: https://skia-review.googlesource.com/18482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-02 19:44:18 +00:00
Robert Phillips
e4d45bf5ba Remove accessRenderTarget call from Clear tests
In the split-opList world the full screen clear optimization no longer relies on the rendertarget ID.

Change-Id: Ifc7bf10753355a18507998e30f9de7e8c1eb57c1
Reviewed-on: https://skia-review.googlesource.com/18497
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-02 19:21:37 +00:00
Ethan Nicholas
b4dc419f0b Re-land "Fixed an issue with sksl variable declarations"
This reverts commit affa6a3da8.

Bug: skia:
Change-Id: I5864830e31acbf786f3ea7ae91f42f10aae6d855
Reviewed-on: https://skia-review.googlesource.com/18459
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 15:11:19 +00:00
Ethan Nicholas
affa6a3da8 Revert "Fixed an issue with sksl variable declarations"
This reverts commit 88bd8edcff.

Reason for revert: unhappy bots

Original change's description:
> Fixed an issue with sksl variable declarations
> 
> There was an issue where multiple variables defined in the same
> declaration were not being sequenced appropriately during analysis, so
> 'int x = 0, y = x + 1' would report that x was undefined.
> 
> Bug: skia:
> Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
> Reviewed-on: https://skia-review.googlesource.com/18313
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

TBR=csmartdalton@google.com,ethannicholas@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Change-Id: Ibc68674289dce70b6173a347a0e78bb0f1e6db1b
Reviewed-on: https://skia-review.googlesource.com/18457
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 13:57:39 +00:00
Ethan Nicholas
88bd8edcff Fixed an issue with sksl variable declarations
There was an issue where multiple variables defined in the same
declaration were not being sequenced appropriately during analysis, so
'int x = 0, y = x + 1' would report that x was undefined.

Bug: skia:
Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
Reviewed-on: https://skia-review.googlesource.com/18313
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 13:23:36 +00:00
Brian Osman
48c9919335 Expand texturability testing to cover mip-mapped textures, and fix iOS
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.

Skip testing of mip-mapped resources in the resource size test,
when creation will fail.

For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.

Now that we're testing our TexStorage path, fix a few other problems
that showed  up:
- Command Buffer doesn't like extension formats.
- X86 PowerVR and Adreno devices don't like BGRA.

Re-land of   : https://skia-review.googlesource.com/18382
Re-re-land of: https://skia-review.googlesource.com/18261

BUG=skia:

Change-Id: Ie12793549a6807300d6ece68cd6b92495e85c3fe
Reviewed-on: https://skia-review.googlesource.com/18403
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-02 13:12:17 +00:00
Robert Phillips
18166eeaf2 Omnibus: Push instantiation of GrTextures later (post TextureSampler)
Split into:
   https://skia-review.googlesource.com/c/10485/ (More GrSurfaceProxy-clean up)
   https://skia-review.googlesource.com/c/15819/ (Expand GrTextureProxy to handle highestFilterMode)
   https://skia-review.googlesource.com/c/16714/ (Switch ImageStorageAccess over to GrTextureProxies)
   https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Change-Id: I6cf3ba0f3bf0e1908d36749bc83571c066ddd568
Reviewed-on: https://skia-review.googlesource.com/10484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-02 11:46:40 +00:00
Brian Osman
842a560470 Revert "Expand texturability testing to cover mip-mapped textures, and fix iOS"
This reverts commit c2b5175e99.

Reason for revert: Nexus 5

Original change's description:
> Expand texturability testing to cover mip-mapped textures, and fix iOS
> 
> Don't allow creation of mip-mapped textures when caps says we don't
> support mip-mapping.
> 
> Skip testing of mip-mapped resources in the resource size test,
> when creation will fail.
> 
> For iOS devices with ES2, the APPLE BGRA8888 extension is more
> trouble than it's worth. Even though it lets the internal and
> external formats not match, it appears that the driver remembers
> the first external format, so subsequent attempts to upload with
> the other swizzle will fail. Up until now, creation of these
> textures was failing anyway, so now just make it more explicit
> that we don't support BGRA in this situation.
> 
> Re-land of: https://skia-review.googlesource.com/18261
> 
> BUG=skia:
> 
> Change-Id: I910ffab0aa735647dce910d9054696c385f94933
> Reviewed-on: https://skia-review.googlesource.com/18382
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG=skia:

Change-Id: I8f0fd87678cc584ad37b2a93a859bd4ef38c8092
Reviewed-on: https://skia-review.googlesource.com/18401
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 18:00:41 +00:00
Brian Osman
c2b5175e99 Expand texturability testing to cover mip-mapped textures, and fix iOS
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.

Skip testing of mip-mapped resources in the resource size test,
when creation will fail.

For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.

Re-land of: https://skia-review.googlesource.com/18261

BUG=skia:

Change-Id: I910ffab0aa735647dce910d9054696c385f94933
Reviewed-on: https://skia-review.googlesource.com/18382
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 17:11:42 +00:00
Mike Klein
761d27c4d7 update SkRasterPipeline::run() to also take y
y isn't used yet.  This is just a warmup that updates the callers.

Change-Id: I78f4f44e2b82f72b3a39fa8a8bdadef1d1b8a99e
Reviewed-on: https://skia-review.googlesource.com/18381
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-01 17:05:13 +00:00
Brian Osman
c674e26950 Revert "Expand texturability testing to cover mip-mapped textures, and fix iOS"
This reverts commit 9f6f41b01b.

Reason for revert: Command Buffer and ANGLE failures.

Original change's description:
> Expand texturability testing to cover mip-mapped textures, and fix iOS
> 
> Don't allow creation of mip-mapped textures when caps says we don't
> support mip-mapping.
> 
> Skip testing of mip-mapped resources in the resource size test,
> when creation will fail.
> 
> For iOS devices with ES2, the APPLE BGRA8888 extension is more
> trouble than it's worth. Even though it lets the internal and
> external formats not match, it appears that the driver remembers
> the first external format, so subsequent attempts to upload with
> the other swizzle will fail. Up until now, creation of these
> textures was failing anyway, so now just make it more explicit
> that we don't support BGRA in this situation.
> 
> BUG=skia:
> 
> Change-Id: Ic2e3ba1673398d542edd46a555ef47b5d0979c01
> Reviewed-on: https://skia-review.googlesource.com/18261
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG=skia:

Change-Id: I68f6bb3be9fbafa7366ef5611a12e372274aa648
Reviewed-on: https://skia-review.googlesource.com/18380
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 16:22:44 +00:00
Florin Malita
69270fbb2b Add smartptr SkRWBuffer snapshot methods
Change-Id: Id816a38213a86bf090230ebaaef00d98a9487965
Reviewed-on: https://skia-review.googlesource.com/18266
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-06-01 16:00:45 +00:00
Brian Osman
9f6f41b01b Expand texturability testing to cover mip-mapped textures, and fix iOS
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.

Skip testing of mip-mapped resources in the resource size test,
when creation will fail.

For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.

BUG=skia:

Change-Id: Ic2e3ba1673398d542edd46a555ef47b5d0979c01
Reviewed-on: https://skia-review.googlesource.com/18261
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-06-01 15:28:07 +00:00
Mike Klein
5cc9da6bbc raster pipeline sprite blitter
The color in the unit test turned out to be right on the edge
of not round tripping well, and I guess rounding pushed it over
the edge, so I've tweaked it to a new one that seems better.

Change-Id: I46095fafc9d6b68fd417ff9dc32003f42929c5a5
Reviewed-on: https://skia-review.googlesource.com/18238
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-01 15:02:08 +00:00
Robert Phillips
8bf1f9ffcf Disable deferred proxies for M60 branch
Bug: 720325
Change-Id: I0529bbcd592bdc5d5a741731af8a66971e485649
Reviewed-on: https://skia-review.googlesource.com/18239
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-31 23:12:39 +00:00
Chris Dalton
1d6163577c Add support for instanced draws
Adds an instance buffer to GrMesh and instance attribs to
GrPrimitiveProcessor. Implements support in GL and Vulkan. Adds unit
tests for instanced rendering with GrMesh.

Bug: skia:
Change-Id: If1a9920feb9366f346b8c37cf914713c49129b3a
Reviewed-on: https://skia-review.googlesource.com/16200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-05-31 20:40:20 +00:00
Ethan Nicholas
d9fe700672 fix incorrect variable not assigned error in skslc
Bug: skia:
Change-Id: Id89db8acb0b14024b79b00d98d32f9c10f019537
Reviewed-on: https://skia-review.googlesource.com/18121
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-31 19:04:56 +00:00
Herb Derby
84dcac3292 Add aarch64 tail code.
Change-Id: I25f029604a04f5fc6c249a3817b0dd84379071be
Reviewed-on: https://skia-review.googlesource.com/18149
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-30 22:04:31 +00:00
Herb Derby
f81c56f3c0 Add arm tail code.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android

Change-Id: Ia0e9f32d0324e66c9d4812dbb156a2b858d49a13
Reviewed-on: https://skia-review.googlesource.com/18127
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-30 19:39:44 +00:00
Chris Dalton
114a3c0b2b Fix glDrawRangeElements
Adds explicit min/max index value fields to GrMesh. This eliminates the
previous assumption that the index values were within the range
[0..vertexCount-1]. In the pattern case we still maintain this
assumption.

Updates GrMesh to hide its fields and handle its new complexity using a
"helper" interface instead.

Adds a unit test for GrMesh.

Bug: skia:
Change-Id: Ia23de72d510f8827cee56072b727fb70a6e46b8d
Reviewed-on: https://skia-review.googlesource.com/17964
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-05-30 16:02:36 +00:00
Robert Phillips
bb581ce30f Convert DstTexture to DstProxy (take 2)
The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed

Reland of: https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: I3a497b6a950fad899f23882c0a9552894ef640f8
Reviewed-on: https://skia-review.googlesource.com/17205
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-29 19:26:26 +00:00
Robert Phillips
9bee2e5894 Revise system for checking for uninstantiated proxies
The new pattern is:
  we will "instantiate" pipelines at flush time
  at flush time we will only access the backing GrSurface by peeking

  If instantiation fails we should never try to access the GrSurfaces


Change-Id: I87f7ff41bd0e84d9ca3dbdd61d3361d3d4ceefd6
Reviewed-on: https://skia-review.googlesource.com/17932
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-29 17:04:51 +00:00
Herb Derby
d1f08302aa Add tests for tail handling in SkJumper.
Change-Id: Ib4ecc33dc9552c16b5530359cd3649487e70bbed
Reviewed-on: https://skia-review.googlesource.com/18067
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-05-26 20:41:04 +00:00
Brian Osman
988adb495d Reduce tree depth on iOS too
Bug: skia:6627
Change-Id: Ib92b62bf1191170a46e63f61fa9502ca2f9ee771
Reviewed-on: https://skia-review.googlesource.com/18072
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-26 20:40:22 +00:00
Brian Osman
4e1868c7f7 Really work around iOS varying limit in GLPrograms test
Bug: skia:6627
Change-Id: I80142f5288e1c6f59f6add3a5a71ab90da90d3cc
Reviewed-on: https://skia-review.googlesource.com/18069
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-26 20:01:31 +00:00
Derek Sollenberger
5480a18d87 Add method to GrContext to purge unlocked resources.
Beyond setting the total cache limits this method enables clients to
request to purge a specific number of bytes, as well as specify their
preference to purge scratch resources over resources of other types.

Change-Id: I9259d5544d34251575d77eebe599388f213ff3ce
Reviewed-on: https://skia-review.googlesource.com/17987
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-26 18:14:33 +00:00
Herb Derby
e7ba8b05d2 Add tail handling for SSE* to SkJumper.
Change-Id: Icb9d385333082de2f99b7a25cfd7251717e3f663
Reviewed-on: https://skia-review.googlesource.com/17580
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-05-25 20:42:08 +00:00
Stephen White
6eca90fea6 GrTessellator: fix for three edges becoming collinear after splitting.
In rare cases, a single edge can become collinear with two adjacent
neighbour edges after it's split. The solution is to continue to merge
until no collinear edges are found.

BUG=722000

Change-Id: Ia5dd212b7acfb40ed1d6c74ebfa9e4a4746fe40a
Reviewed-on: https://skia-review.googlesource.com/17963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-05-25 19:33:17 +00:00
Florin Malita
4aed13889b Reland of SkShaderBase
Introduce a private base class (SkShaderBase), to hide
implementation details from the public interface (SkShader).

Change-Id: Ib1d76cde880bd51868b97408710f8bb38128e536
Reviewed-on: https://skia-review.googlesource.com/17925
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-25 14:59:07 +00:00
Robert Phillips
3b3307f2b1 Disable MSAA for Intel GPUs and re-enable GrSurfaceRenderability test
This CL replaces: https://skia-review.googlesource.com/c/17710/ (Re-enable GrSurfaceRenderability test)

Change-Id: I5626e4fc3581cd2b17fe0f0ad3a9e9bc35b7aa4c
Reviewed-on: https://skia-review.googlesource.com/17764
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-25 13:40:16 +00:00
Mike Klein
c998f733e3 make sure to_srgb maps 1 to 1
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android,Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Android-Clang-Ci20-CPU-IngenicJZ4780-mipsel-Release-Android

BUG=skia:6678,skia:6683

Change-Id: I217084fa0a11ad661a8751f0c3b1cade5cc52473
Reviewed-on: https://skia-review.googlesource.com/17902
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-25 13:25:47 +00:00
Florin Malita
d93e11ceb4 Revert "SkShaderBase"
This reverts commit 58a756435c.

Reason for revert: g3, Android borkage.

Original change's description:
> SkShaderBase
> 
> Introduce a private base class (SkShaderBase), to hide
> implementation details from the public interface (SkShader).
> 
> Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176
> Reviewed-on: https://skia-review.googlesource.com/17241
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I32b012ee466dd006c074593f211f43ed602f1078
Reviewed-on: https://skia-review.googlesource.com/17845
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-24 21:15:57 +00:00
Florin Malita
58a756435c SkShaderBase
Introduce a private base class (SkShaderBase), to hide
implementation details from the public interface (SkShader).

Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176
Reviewed-on: https://skia-review.googlesource.com/17241
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-24 19:56:15 +00:00
Florin Malita
14a6430b7b SkSTArenaAlloc
Syntactic sugar, gets rid of some boilerplate.

Change-Id: Ibdb28b7a8f1d5e4a4e18c12d423b987d7194e340
Reviewed-on: https://skia-review.googlesource.com/17837
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-05-24 19:20:45 +00:00
Mike Reed
176f19cce5 Use rasterpipeline for drawVertices
Bug: skia:
Change-Id: If6da119ee98f26981cef9373162ddb526db77be5
Reviewed-on: https://skia-review.googlesource.com/17422
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-05-24 18:43:05 +00:00
Derek Sollenberger
ee47914ae5 Add GrContext API to report the number of purgeable bytes in the cache.
Change-Id: I1457eec9831736f386e3b3b80d9eac8dbb337a9b
Reviewed-on: https://skia-review.googlesource.com/17829
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-24 17:08:45 +00:00
Mike Klein
b24704d35f SkRasterPipeline in SkArenaAlloc
Bug: skia:6673

Change-Id: Ia2bae4f6a9039a007a10b6b45bcf2f0854bf6e5c
Reviewed-on: https://skia-review.googlesource.com/17794
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-24 14:54:15 +00:00
Brian Salomon
d17b4a678b Revert "Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. ""
This reverts commit a9e795eab5.

Bug: skia:
Change-Id: Ibfc51497ae99f332f8f72a799393a1b2996f7f3f
Reviewed-on: https://skia-review.googlesource.com/17767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 21:38:38 +00:00
Brian Salomon
a9e795eab5 Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. "
This reverts commit 45e5068a6d.

Reason for revert: :'(

Original change's description:
> Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. 
> 
> Bug: chromium:656320
> 
> Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
> Reviewed-on: https://skia-review.googlesource.com/17391
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: chromium:656320

Change-Id: I8a4f71537e45f3c4cf37b10b2dc8ee38fe6959ba
Reviewed-on: https://skia-review.googlesource.com/17765
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 19:03:01 +00:00
Brian Salomon
45e5068a6d Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation.
Bug: chromium:656320

Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
Reviewed-on: https://skia-review.googlesource.com/17391
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 18:07:25 +00:00
Leon Scroggins III
557fbbe05b Add animation support to SkWebpCodec
TBR=reed@google.com
(No change to the public API, but changed a header file)

SkWebpCodec:
- Implement onGetFrameCount, onGetFrameInfo, and onGetRepetitionCount
- Respect the alpha reported by libwebp. Although the spec states that
  it is only a hint, the libwebp encoder uses it properly. Respecting
  allows us to draw opaque images faster and decode them to 565. This
  also matches other SkCodecs (and Chromium).
- onGetPixels:
  - Decode the frame requested, recursively decoding required frame if
    necessary
  - When blending with a prior frame, use SkRasterPipeline

SkCodec:
- Move check for negative index to getFrameInfo
- Reset the colorXform if one is not needed

SkCodecAnimation:
- Add new blend enum, for WebP's (and APNG's) non-blending option

SkFrameHolder:
- New base classes for frames and the owner of the frames, allowing
  code sharing between SkWebpCodec and SkGifCodec (particularly for
  determining whether a frame has alpha and what frame it depends on)
- When moving items from SkGIFFrameContext, use Skia conventions (i.e.
  int instead of unsigned)
- Rename "delay time" to "duration", to match e.g. SkFrameInfo::
  fDuration

SkGifImageReader:
- Move pieces to SkFrameHolder, and adapt to changes made in the
  process
- Make setAlphaAndRequiredFrame (now on the base class SkFrameHolder)
  more general to support webp, and add support for frames that do not
  blend
- Change SkGIFFrameContext from a struct to a class, to match how we
  use the distinction elsewhere (i.e. struct is a small object with
  public fields)
- Rework hasTransparentPixel (now hasTransparency, since it returns true
  in some cases where there is not a transparent pixel) to better fit
  with the modified setAlphaAndRequiredFrame. Also be more consistent
  when there is no transparent pixel but no color map.
- Simplify an if condition that was previously simplified in 2d61e717
  but accidentally got reverted in a4db9be6

CodecAnimTest:
- Test new animated webp files
- Rearrange the test to more cleanly print alpha type mismatches for
  the first frame

resources:
- webp-animated.webp
  - animated webp from Chromium
- blendBG.webp
  - new webp file using bits of webp-animated-semitransparent4.webp
    from Chromium
  - tests required frame and alpha when using the non-blending mode
  - frames have the following properties:
    - Frame 0: no alpha, fills screen
    - Frame 1: alpha, fills screen
    - Frame 2: no alpha, fills screen
    - Frame 3: alpha, fills screen, blendBG
    - Frame 4: no alpha, fills screen, blendBG
    - Frame 5: alpha, blendBG
    - Frame 6: covers 4, has alpha, blendBG
  - also used to test decoding to 565 if the new frame data has alpha
    but blends onto an opaque frame

DM.cpp:
- Test animated images to non-native 8888 and unpremul

DMSrcSink.cpp:
- Do not test non-native 8888 decodes to f16 dst
- Test unpremul decodes to f16
- Copy a frame of an animated image prior to drawing, since in unpremul
  mode, the DM code will premultiply first.

Bug: skia: 3315
Change-Id: I4e55ae2ee5bc095b37a743bdcfac644be603b980
Reviewed-on: https://skia-review.googlesource.com/16707
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-23 15:28:37 +00:00
Robert Phillips
92de631edd Remove compressed (ETC1) texture support from Ganesh (take 2)
Reland of https://skia-review.googlesource.com/c/17456/ (Remove compressed (ETC1) texture support from Ganesh) but w/o removing third_part\etc1 files

TBR=bsalomon@google.com
Change-Id: I8ec4b7e3ddf47d213cb24c382731c050ffb8847f
Reviewed-on: https://skia-review.googlesource.com/17700
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-23 12:45:21 +00:00
Greg Daniel
79cdf28c51 Fix to lcd blending in ganesh
This fixes the bug where a src color may originally be opaque but after
blending it is no longer opaque. We need to know the opacity after the
blend so this restricts us on which blend modes even work this way.

Bug: skia:
Change-Id: Ib3208887d718e5f25272ed7b0bf44683d04884d7
Reviewed-on: https://skia-review.googlesource.com/17488
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 20:35:17 +00:00
Brian Osman
bc262e110a Revert "Remove compressed (ETC1) texture support from Ganesh"
This reverts commit ee26363aaa.

Reason for revert: Failing Google 3 roll.

Original change's description:
> Remove compressed (ETC1) texture support from Ganesh
> 
> Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
> Reviewed-on: https://skia-review.googlesource.com/17456
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie1a57187287e03600a69e374501478e93c41415c
Reviewed-on: https://skia-review.googlesource.com/17527
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-22 20:14:50 +00:00
Brian Salomon
7128fdd82d Remove kZeroCopy_GrSurfaceFlag
Change-Id: I2869f97a14f3a1363ebfef5d657bd6468fc991f7
Reviewed-on: https://skia-review.googlesource.com/17491
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-22 18:50:58 +00:00
Robert Phillips
ee26363aaa Remove compressed (ETC1) texture support from Ganesh
Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
Reviewed-on: https://skia-review.googlesource.com/17456
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 18:02:52 +00:00
Robert Phillips
b7b7e5fba0 Add fixes & test for isConfigTexturable and isConfigRenderable
This CL fixes:
  isConfigTexturable was returning true for:
            kRG_float for ANGLE ES2 configs
  isConfigRenderable was returning true for:
            kAlpha_8 for ANGLE ES2 configs
  isConfigTexturable and isConfigRenderable were returning true for:
            SBGRA on ES2
  The NexusPlayer was marking RGBA & RG float configs as renderable but not textureable

Bug: 720325

Change-Id: If21361870dbdde8f3e09bc9dff3a394f2a329157
Reviewed-on: https://skia-review.googlesource.com/17387
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 17:55:48 +00:00
Matt Sarett
2f68787783 SkWebpEncoder: use bgra for lossless and yuv for lossy
Previosuly, we would (accidentally) always use just yuv.

Bug: 713862
Change-Id: I00acc6ca2841ba0636494119b7b4f46a9deee401
Reviewed-on: https://skia-review.googlesource.com/17406
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-05-19 23:35:46 +00:00
Greg Daniel
6ebe4b9dbe Fix gpu lcd blending to semi-correctly handle alpha coverage
Bug: skia:6606
Change-Id: I16ccd97f5d047eb7fddfed5310bf669e7435ccdd
Reviewed-on: https://skia-review.googlesource.com/17370
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-19 17:20:33 +00:00
Brian Salomon
bb5711a5e4 Remove GrSurfaceDesc member from GrSurfaceProxy.
Stores the config, origin, and dimensions in GrSurfaceProxy, sample count in GrRenderTargetProxy, and "was constructed with mip maps" in GrTextureProxy.

Change-Id: Iee058674dce49107a991cca9d083cd33e3572809
Reviewed-on: https://skia-review.googlesource.com/17209
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-17 18:17:50 +00:00
Ethan Nicholas
4b330dfd33 skslc comma operator and optimizer fixes
Bug: skia:
Change-Id: I732d4fba843c06af570d4a56cadfaa1cc565808c
Reviewed-on: https://skia-review.googlesource.com/17125
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-05-17 15:22:05 +00:00
Robert Phillips
c375704a20 Revert "Convert DstTexture to DstProxy"
This reverts commit 87f7f1c3ce.

Reason for revert: grumble, grumble

Original change's description:
> Convert DstTexture to DstProxy
> 
> The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed
> 
> Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))
> 
> Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0
> Reviewed-on: https://skia-review.googlesource.com/16908
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=egdaniel@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I9af52bb222bd2d8cc696250a9efb62afb80edba1
Reviewed-on: https://skia-review.googlesource.com/17203
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-17 13:00:27 +00:00
Robert Phillips
87f7f1c3ce Convert DstTexture to DstProxy
The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed

Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0
Reviewed-on: https://skia-review.googlesource.com/16908
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-17 12:17:03 +00:00
Matt Sarett
d5a16911bb Add support for webp lossless compression
Bug: 713862
Change-Id: I8dcc6506338f3c54fb14a78620e7daaadadfedde
Reviewed-on: https://skia-review.googlesource.com/17073
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-17 02:24:29 +00:00
Mike Reed
c090c647e4 move files out of private, and fix up callers to IWYU
Realized that a pending CL needed to add (yet another) private type to SkRecords.h, but w/o this CL I'd be forced to move that header also into private. This change frees us up to not have transitive exposure for types that need to be recorded.

Bug: skia:
Change-Id: Id79f1c2e44ba85e063c1360cf96c92de6397ca2b
Reviewed-on: https://skia-review.googlesource.com/17031
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-16 21:29:03 +00:00
Mike Klein
ca2194b38e add a test that sRGB stages round trip
Change-Id: Ide8303f6fc162f3703f7db298fe210d47225a580
Reviewed-on: https://skia-review.googlesource.com/16988
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-15 23:57:48 +00:00
Chris Dalton
bca46e29e9 Convert GrMesh back to a class
Specific methods that limit the data to valid configurations are better
than a runtime mega-assert.

Bug: skia:
Change-Id: Ie15f2dc79659e44cfaddd16eb474795b110fda73
Reviewed-on: https://skia-review.googlesource.com/16577
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-15 18:01:59 +00:00
Brian Salomon
e334c59654 Attempt to work around iOS varying limit in GLPrograms test
Dump shaders when linking fails.

Bug: skia:6627
Change-Id: I7f1df4be039eb56d990aa64c58c8dd2a22d97dbe
Reviewed-on: https://skia-review.googlesource.com/16867
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-15 15:41:01 +00:00
Robert Phillips
8a02f65c5c Switch ImageStorageAccess over to GrTextureProxies
Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: I341de6ae121620d30e50bff21450878a18bdf4f2
Reviewed-on: https://skia-review.googlesource.com/16714
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-12 19:20:22 +00:00
Brian Salomon
177266339c Include non-legacy GrMeshDrawOps in GLPrograms test.
Bug: skia:
Change-Id: Ifa0c3ffb5643c84ccdcb339fae75ea5d03a8451c
Reviewed-on: https://skia-review.googlesource.com/16580
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-12 19:08:32 +00:00
Matt Sarett
ebb1b5c297 Add new SkImageGenerator::getPixels() API, deprecate the old
This is fairly aggressive in that it will break any client
that is currently using SkImageGenerator with kIndex8.
I'm guessing that we don't have any clients doing that.

Bug: skia:6620
Change-Id: Ifd16f5232bb3a9f759c225315c57492d917ed9ca
Reviewed-on: https://skia-review.googlesource.com/16601
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-12 16:48:17 +00:00
Brian Salomon
7c8460e101 Make GrRenderTarget[(Proxy)|(Context)]? advertise a "full scene aa type".
Bug: skia:
Change-Id: I24549604e8305028e34e0022bfef992a8e8c33f7
Reviewed-on: https://skia-review.googlesource.com/16230
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-12 16:32:57 +00:00
Robert Phillips
6cdc22cde8 Split up opLists (take 3)
Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.

TBR=egdaniel@google.com
Change-Id: I2a09729342bb035af3a16807c1895adbae432ade
Reviewed-on: https://skia-review.googlesource.com/14186
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-12 12:10:31 +00:00
Robert Phillips
b6deea8f0e Setup for another attempt to split up opLists
Split out of: https://skia-review.googlesource.com/c/14186 (Split up opLists (take 3))

Change-Id: Ifa600c88fb9185991d3197c7776c820f54c9bf0f
Reviewed-on: https://skia-review.googlesource.com/16540
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-11 19:44:39 +00:00
Brian Osman
85d34b2e84 Remove SkCrossContextImageData and all support code
Bug: skia:
Change-Id: I8eb8cef5456c05a8e314d8404698893c7af82d13
Reviewed-on: https://skia-review.googlesource.com/16368
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-11 18:07:20 +00:00
Ethan Nicholas
5ac13c2362 sksl support for static ifs & switches
Bug: skia:
Change-Id: Ic9e01a3a18efddb19bab26e92bfb473cad294fc1
Reviewed-on: https://skia-review.googlesource.com/16144
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-05-10 19:31:34 +00:00
Mike Reed
14113bcc4e add flag to hide deprecated clipops
needs this to land first
https://codereview.chromium.org/2877493002/#

Bug: skia:3191
Change-Id: Iff5271064877c4e96353d3564464f513eaad0bb5
Reviewed-on: https://skia-review.googlesource.com/16365
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-05-10 18:56:14 +00:00
Brian Salomon
ac70f84e7f Move all non-AA fill rect ops off of GrLegacyMeshDrawOp.
This adds perspective to GrNewNonAAFillRectOp, renames it to GrNonAAFillRectOp, and deletes the previous version of that namespace.

Change-Id: I20f35bf019f9c9105e6ec83dda11328451138109
Reviewed-on: https://skia-review.googlesource.com/15634
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-10 14:48:47 +00:00
Brian Osman
13dddce65f Added SkImage::MakeCrossContextFromEncoded
Designed for Flutter's threading architecture, with
an eye to being useful to other clients. Under the
hood, uses a new image generator class to lazily wrap
a texture for multiple GrContexts.

Re-land of https://skia-review.googlesource.com/c/14180/

Bug: skia:
Change-Id: I3dd382640629b79b3058f18fee68d043566e43e5
Reviewed-on: https://skia-review.googlesource.com/15895
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-09 18:45:04 +00:00
Matt Sarett
fe3190846c Add downsampling option to SkJpegEncoder
Bug: 713862
Change-Id: Ibad6ecf836ccfd355499e1bace7bcd4ba772a97a
Reviewed-on: https://skia-review.googlesource.com/15891
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-05-09 18:37:10 +00:00
Eric Karl
5c77975e4c Add flag to avoid stencil buffers in Skia
Certain systems experience a leak in the GL driver associated with
stencil buffers. Attempts to avoid the leak (while still using stencil
buffers) dind't succeed. This patch adds a GrContextOption
fAvoidStencilBuffers. This disables certain path rendering modes, as
well as stencil based masking/clipping.

Bug: 713854
Change-Id: Ifa6c0f2bd5ee395547bda9165d6c79d197ae8b8b
Reviewed-on: https://skia-review.googlesource.com/15253
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-09 17:41:25 +00:00
Brian Salomon
449d78f5a8 Revert "Added SkImage::MakeCrossContextFromEncoded"
This reverts commit 83b1b3db36.

Reason for revert: unit test failing and asan leaks

Original change's description:
> Added SkImage::MakeCrossContextFromEncoded
> 
> Designed for Flutter's threading architecture, with
> an eye to being useful to other clients. Under the
> hood, uses a new image generator class to lazily wrap
> a texture for multiple GrContexts.
> 
> Bug: skia:
> Change-Id: I6c37b12c8ab5bce94b91190e5f0beb91d31ae81b
> Reviewed-on: https://skia-review.googlesource.com/14180
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1f0bf580aa0ea2d132e18b64ff610ddac9d073a7
Reviewed-on: https://skia-review.googlesource.com/15892
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-08 20:46:26 +00:00
Brian Osman
83b1b3db36 Added SkImage::MakeCrossContextFromEncoded
Designed for Flutter's threading architecture, with
an eye to being useful to other clients. Under the
hood, uses a new image generator class to lazily wrap
a texture for multiple GrContexts.

Bug: skia:
Change-Id: I6c37b12c8ab5bce94b91190e5f0beb91d31ae81b
Reviewed-on: https://skia-review.googlesource.com/14180
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-08 19:56:27 +00:00
Jim Van Verth
e308a122ef Remove height functor for shadows and replace with plane equation params
Change-Id: I948eceb2c58dc50468993dba54c209f18e440e48
Reviewed-on: https://skia-review.googlesource.com/15873
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-08 18:42:48 +00:00
Robert Phillips
b37208f11a Revert "Revert "Re-enable deferred proxies in Chrome""
This reverts commit 05814de6ba.

Reason for revert: Chrome layout test suppressions have landed

Original change's description:
> Revert "Re-enable deferred proxies in Chrome"
> 
> This reverts commit 555c49c347.
> 
> Reason for revert: layout tests
> 
> Original change's description:
> > Re-enable deferred proxies in Chrome
> > 
> > Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.
> > 
> > Bug: 715488
> > Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
> > Reviewed-on: https://skia-review.googlesource.com/15252
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: Ie90e64a2e4d5efc4b6909a04f8a862dd3a708d97
> Reviewed-on: https://skia-review.googlesource.com/15809
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I957e8e59af2b2f441c75bae2eda4dcd5ed82b34d
Reviewed-on: https://skia-review.googlesource.com/15876
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 18:10:02 +00:00
Matt Sarett
be4c9b0a8b Add filtering and zlib-level options to SkPngEncoder
Bug: skia:6409
Bug: 713862
Change-Id: If287e2bcad5af990fac11e9091305f45ec903dbf
Reviewed-on: https://skia-review.googlesource.com/15647
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-08 16:43:44 +00:00
Ethan Nicholas
2983f4022d Re-land of "eliminated GrGLSLExpr".
This change is exactly the same as the last time it was landed; I believe the
underlying optimizer bug that was causing this to cause problems has been
fixed by a prior CL.
Bug: skia:
Change-Id: I5436422f094ea758caa3cd69e9338db31b1f93fa
Reviewed-on: https://skia-review.googlesource.com/15768
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-08 16:08:44 +00:00
Brian Osman
0562eb9c6c Allow wrapped resources to have unique keys
Previously, wrapped resources were never budgeted. Now we explicitly allow
wrapped, unbudgeted resources with unique keys. This allows code that
wraps (and re-wraps) external resources with a deterministic key to find
the same wrapped resource - saving time and ensuring a single wrapped
copy, to preserve state on the resource (like texture sampler state).

Bug: skia:
Change-Id: I1dd7642f1ed8bb6c620029d46203cf5cb6b3c160
Reviewed-on: https://skia-review.googlesource.com/15241
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-08 15:48:44 +00:00
Robert Phillips
05814de6ba Revert "Re-enable deferred proxies in Chrome"
This reverts commit 555c49c347.

Reason for revert: layout tests

Original change's description:
> Re-enable deferred proxies in Chrome
> 
> Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.
> 
> Bug: 715488
> Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
> Reviewed-on: https://skia-review.googlesource.com/15252
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie90e64a2e4d5efc4b6909a04f8a862dd3a708d97
Reviewed-on: https://skia-review.googlesource.com/15809
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 15:18:53 +00:00
Robert Phillips
555c49c347 Re-enable deferred proxies in Chrome
Now that https://skia-review.googlesource.com/c/14605/ (Allow TextureSamplers to have null GrTexture pointer) has landed we should be able to re-enable deferred proxies in Chrome.

Bug: 715488
Change-Id: Ibd38e5ddf0558b94f09e29f17837e6abfd22fa34
Reviewed-on: https://skia-review.googlesource.com/15252
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-08 11:49:54 +00:00
Matt Sarett
41a8ec060e Fix implicit ptr to bool
Bug: skia:
Change-Id: I11ce7858306dfe05162aa84a5f862b1b01c2cee9
Reviewed-on: https://skia-review.googlesource.com/15637
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-05 19:31:41 +00:00
Matt Sarett
04c3731de8 SkEncoder: Rename files, change webp API, for consistency
Bug: skia:
Change-Id: I3dd6feb3d5661dcad3d2388b4d01fa9d3bbb15bb
Reviewed-on: https://skia-review.googlesource.com/15631
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-05 18:56:46 +00:00
Matt Sarett
c367d03fb0 Add support for row-by-row png encodes
Also adds a SkEncoder base class.

Bug: 713862
Change-Id: Ia3f009cd9f376514f6c19396245fab3a43ae6536
Reviewed-on: https://skia-review.googlesource.com/15152
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-05 16:34:13 +00:00
Chris Dalton
fe199b7d51 Add postFlush call to GrOnFlushCallbackObject
Adds a new postFlush method and renames the class to
GrOnFlushCallbackObject. Also removes the ref counting in favor of
making the callback object a purely virtual interface. ref/unref on the
callback interface would conflict with existing ref/unref methods on the
subclass. It is now the caller’s responsibility to ensure the lifetime
of the callback is tied to that of the context.

Bug: skia:
Change-Id: I2fc1f98c700032e296a36f3a9a09c0753ab47aea
Reviewed-on: https://skia-review.googlesource.com/15463
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-05 15:53:36 +00:00
Matt Sarett
9d687dfa3e Avoid interpolating color lut with less than 2 points
Bug: 717935
Change-Id: Ibf15b815891eef5a0239bc408bcbfe7c8b1507c5
Reviewed-on: https://skia-review.googlesource.com/15301
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-05 15:18:03 +00:00
Hal Canary
788c3c467a SkDiscardableMemoryPool: always have a mutex for testing
Change-Id: I898058f1125f62832f2b2b661c661efb0f84da6d
Reviewed-on: https://skia-review.googlesource.com/14274
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-05-05 15:10:13 +00:00
Ethan Nicholas
c2371a4e32 sksl optimizer fixes
The main issue was a use-after-free due to removing (and thus destroying)
the binary expression prior to re-adding part of it. Also cleaned up the
way dead assignments are handled and added the test that originally
identified these problems.

Bug: skia:
Change-Id: Icda93d69a66c4e57850ecdc88fc4a4f634e1aac2
Reviewed-on: https://skia-review.googlesource.com/15383
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-05-05 14:26:38 +00:00
Hal Canary
209e4b1b70 Revert "Revert "SkTypeface::getAdvancedMetrics(): cleanup""
This reverts commit 59ad782b2b.

   - SkAdvancedTypefaceMetrics is a struct not a class
   - SkTypeface::PerGlyphInfo is gone
   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
     used same arguments.)
   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I91b56e60f7d9de7d46c426c6bd34ce124e0cf00e
Reviewed-on: https://skia-review.googlesource.com/15360
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-05 13:53:40 +00:00
Hal Canary
59ad782b2b Revert "SkTypeface::getAdvancedMetrics(): cleanup"
This reverts commit cef018896e.

Reason for revert: broke chromium roll (windows).

Original change's description:
> SkTypeface::getAdvancedMetrics(): cleanup
> 
>   - SkAdvancedTypefaceMetrics is a struct not a class
>   - SkTypeface::PerGlyphInfo is gone
>   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
>   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
>   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
>   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
>     used same arguments.)
>   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
>   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt
> 
> Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
> Reviewed-on: https://skia-review.googlesource.com/15311
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

TBR=halcanary@google.com,bungeman@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I84c7d53df566aaf83427e3368edaa02b7b5a9cb8
Reviewed-on: https://skia-review.googlesource.com/15319
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 18:20:45 +00:00
Hal Canary
cef018896e SkTypeface::getAdvancedMetrics(): cleanup
- SkAdvancedTypefaceMetrics is a struct not a class
  - SkTypeface::PerGlyphInfo is gone
  - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
  - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
  - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
  - [on]getAdvancedMetrics no longer has parameters. (Only caller always
    used same arguments.)
  - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
  - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
Reviewed-on: https://skia-review.googlesource.com/15311
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 16:57:43 +00:00
Mike Klein
ba9028440b try re-enabling test_diagonal on 565
I just landed a CL that changed dithering enough that it's worth seeing
if this test passes again.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android

Change-Id: I1dfd27fdc7d8646e0008b667617383c08c7abd5a
Reviewed-on: https://skia-review.googlesource.com/15315
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 16:37:13 +00:00
Jim Van Verth
060d982036 Combine the ambient and spot alphas into the base color
for geometric shadows. 

This matches the analytic shadow approach better, and
is color space invariant.
Also includes cleanup in SampleAndroidShadows.

Bug: skia:6546
Change-Id: I7a7cd060420dae741f967334c8b19542a14f0bcf
Reviewed-on: https://skia-review.googlesource.com/15228
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-04 14:28:28 +00:00
Ethan Nicholas
421fe443f8 Revert "Revert "Revert "eliminated GrGLSLExpr"""
This reverts commit 796001c82e.

Reason for revert: looks to be causing problems in Chrome (https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_Trusty__dbg_/1553/layout-test-results/results.html)

Original change's description:
> Revert "Revert "eliminated GrGLSLExpr""
> 
> This reverts commit 5e550ab57e.
> 
> Bug: skia:
> Change-Id: I4705e47dbd209aa8f43db3d28c856bd3aa9e49ab
> Reviewed-on: https://skia-review.googlesource.com/15187
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

TBR=ethannicholas@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I6455a4f16b2dc0d6d1265541f7117e0cfb8dd91c
Reviewed-on: https://skia-review.googlesource.com/15309
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-04 13:11:09 +00:00
Stephen White
64dbb89efc GrTessellator: fix for vertex coincident with enclosing edge.
If a previously-enclosing edge coincides exactly with the current 
vertex, there are no two adjacent edges which enclose the vertex.
Since find_enclosing_edges() ensures that the left enclosing edge
is to the left of the vertex, the fix is to split the right 
enclosing edge on the current vertex and restart intersection 
tests.

Bug: 716720
Change-Id: Id26c5b92a6d6139f348e99554638cded37e81a8e
Reviewed-on: https://skia-review.googlesource.com/15261
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-05-04 05:10:48 +00:00
Mike Klein
69b1045ce2 disable test_diagonal on 565
We're no longer necessarily going to get exact results as we go along.
Lots of little things like dither, FMA, whether we're using the full
precision pipeline or the old paths, etc.

Change-Id: Iacba1820e79cd1e380d3af7861d9678ca7b93ad8
Reviewed-on: https://skia-review.googlesource.com/15246
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-03 20:45:35 +00:00
Florin Malita
ab244f045a Revert "Revert "Reland: Remove SkLights include from SkCanvas.h""
This reverts commit 9d5f66d9c2.

Reason for revert: Leon landed Android fixes.

Original change's description:
> Revert "Reland: Remove SkLights include from SkCanvas.h"
> 
> This reverts commit fed00319c9.
> 
> Reason for revert: breaking the Android roll.
> 
> Original change's description:
> > Reland: Remove SkLights include from SkCanvas.h
> > 
> > SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> > works fine).
> > 
> > Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> > TBR=reed@google.com
> > Reviewed-on: https://skia-review.googlesource.com/15143
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > 
> 
> TBR=fmalita@chromium.org,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
> Reviewed-on: https://skia-review.googlesource.com/15195
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

TBR=msarett@google.com,reviews@skia.org,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I0a1c2f9df61f16987ab72dfb4f3a205fbcc37667
Reviewed-on: https://skia-review.googlesource.com/15229
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 19:17:11 +00:00
Chris Dalton
ff92650206 Convert GrMesh to a struct
Converts GrMesh to a struct and changes the names/semantics of its
fields to be more inline with their GL counterparts. Also renames the
"instancing" feature to "pattern", to avoid ambiguity with hardware
instancing.

Bug: skia:
Change-Id: Ia0999d4f9c83b5dd31f81b9bf4f36ed9abd26286
Reviewed-on: https://skia-review.googlesource.com/15157
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-03 19:08:40 +00:00
Robert Phillips
a91e0b7cc2 Allow TextureSamplers to have null GrTexture pointer
Bug: 715488

Change-Id: I69775cbb50d334d81872e236e59368fe65e698ff
Reviewed-on: https://skia-review.googlesource.com/14605
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-03 16:59:37 +00:00
Florin Malita
9d5f66d9c2 Revert "Reland: Remove SkLights include from SkCanvas.h"
This reverts commit fed00319c9.

Reason for revert: breaking the Android roll.

Original change's description:
> Reland: Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
> TBR=reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/15143
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> 

TBR=fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3b0e69f1d04d160f16a5567b09982d35cc9ca84e
Reviewed-on: https://skia-review.googlesource.com/15195
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-03 15:41:07 +00:00
Ethan Nicholas
796001c82e Revert "Revert "eliminated GrGLSLExpr""
This reverts commit 5e550ab57e.

Bug: skia:
Change-Id: I4705e47dbd209aa8f43db3d28c856bd3aa9e49ab
Reviewed-on: https://skia-review.googlesource.com/15187
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-03 14:13:41 +00:00
Florin Malita
fed00319c9 Reland: Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: I3ed97cd7861e51dcb7cfa7950a97b420dbc6fbfb
TBR=reed@google.com
Reviewed-on: https://skia-review.googlesource.com/15143
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-03 13:22:28 +00:00
Jim Van Verth
343fe49b82 Remove translateZ and lights from SkCanvas
Bug: skia:6557
Change-Id: I0dbf70c4131ab59e7fc6c674a6587767af98e13a
Reviewed-on: https://skia-review.googlesource.com/15151
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-02 21:17:01 +00:00
Brian Salomon
5e550ab57e Revert "eliminated GrGLSLExpr"
This reverts commit 93f20f5629.

Reason for revert: Mismerge readded deleted files.

Original change's description:
> eliminated GrGLSLExpr
> 
> Now that skslc performs all of the optimizations (and then some) that
> GrGLSLExpr is responsible for, it's just extra work for no benefit.
> 
> Bug: skia:
> Change-Id: I40b0629e00a33873ed9fc6c0a9f41d8350221f9a
> Reviewed-on: https://skia-review.googlesource.com/14560
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,ethannicholas@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ia8b723594527afe34489fc78a4b49039081b6390
Reviewed-on: https://skia-review.googlesource.com/15154
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-02 21:07:32 +00:00
Matt Sarett
26b44df233 Add support for row-by-row jpeg encoding
Reland of:
https://skia-review.googlesource.com/c/14641/

Bug: 713862
Change-Id: I9dca5ede4ebf569c5f80edcfb23a506b6cfa935e
Reviewed-on: https://skia-review.googlesource.com/15144
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-02 20:40:10 +00:00
Ethan Nicholas
93f20f5629 eliminated GrGLSLExpr
Now that skslc performs all of the optimizations (and then some) that
GrGLSLExpr is responsible for, it's just extra work for no benefit.

Bug: skia:
Change-Id: I40b0629e00a33873ed9fc6c0a9f41d8350221f9a
Reviewed-on: https://skia-review.googlesource.com/14560
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-02 20:05:56 +00:00
Ethan Nicholas
0dd30d9928 sksl support for buffer blocks
Bug: skia:
Change-Id: Ic2cabaf2c7fb23cec7863f2b6152bbed133e0886
Reviewed-on: https://skia-review.googlesource.com/14947
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-02 17:39:45 +00:00
Leon Scroggins
c06f309cf5 Revert "Add support for row-by-row jpeg encoding"
This reverts commit 9b848d5749.

Reason for revert: ASAN reports leaked memory [1]. Google3 reports a "delete size mismatch" [2], which I suspect is the same issue.

[1] https://chromium-swarm.appspot.com/task?id=35e2c9fa9eac6310&refresh=10&show_raw=1
[2] https://test.corp.google.com/ui#cl=154838904&flags=CAMQBQ==&id=OCL:154838904:BASE:154839043:1493741642370:9c96115f&t=//chrome/skia/dm_wrapper:dm_wrapper

Original change's description:
> Add support for row-by-row jpeg encoding
> 
> Bug: 713862
> Change-Id: I787b7c49662a00b89ae0ef35845dfbd6be3e6fb1
> Reviewed-on: https://skia-review.googlesource.com/14641
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

TBR=msarett@google.com,scroggo@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ic5a8d67e0d4a7733662586055ceff086a2ab335d
Reviewed-on: https://skia-review.googlesource.com/15140
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-05-02 17:08:35 +00:00
Matt Sarett
9b848d5749 Add support for row-by-row jpeg encoding
Bug: 713862
Change-Id: I787b7c49662a00b89ae0ef35845dfbd6be3e6fb1
Reviewed-on: https://skia-review.googlesource.com/14641
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-05-02 16:07:15 +00:00
Greg Daniel
a18d2db2fc Fix VkWrapTest
Fix current breakage on bots.

Bug: skia:
Change-Id: I4b60ef85d941a179d76cccc1a468aaa6437caddc
Reviewed-on: https://skia-review.googlesource.com/15104
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-02 16:05:35 +00:00
Florin Malita
38aad81a54 Revert "Remove SkLights include from SkCanvas.h"
This reverts commit 9ff301bf91.

Reason for revert: need to update G3, Flutter.

Original change's description:
> Remove SkLights include from SkCanvas.h
> 
> SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
> works fine).
> 
> Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
> Reviewed-on: https://skia-review.googlesource.com/14904
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> 

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I4799ad5b31aaeaf529c8b912bbe09aa8869a5e6c
Reviewed-on: https://skia-review.googlesource.com/15107
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 15:42:07 +00:00
Florin Malita
9ff301bf91 Remove SkLights include from SkCanvas.h
SkLights.h pulls in a bunch of other headers and is not needed (fwdecl
works fine).

Change-Id: Id2d7176eb3bf4609f72f46d513eebf59318f542f
Reviewed-on: https://skia-review.googlesource.com/14904
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-02 14:50:38 +00:00
Greg Daniel
207282eb5a Make GrBackendTexture take Gr*Info refs in ctor, and copy them.
Bug: skia:
Change-Id: Ic05d3384fa07560fc18c52bb8ae03541a72515f7
Reviewed-on: https://skia-review.googlesource.com/14374
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-02 14:08:28 +00:00