aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
Commit message (Collapse)AuthorAge
* Add GrTextureRenderTargetProxy and support switching between RT & Tex ProxiesGravatar Robert Phillips2016-11-07
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4427 Change-Id: Ie7662299953592f564bb27a4df4ea101f743403e Reviewed-on: https://skia-review.googlesource.com/4427 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear.""Gravatar Brian Salomon2016-11-07
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit ce4d04ae8eace6ba53ff8b8c8d8f4a2e6af4e59f. BUG=skia:5932 Original CL description: > >Limit GL_TEXTURE_RECTANGLE filtering to bilinear. > >Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures. > >Also moves samplerType() to GrTexturePriv from GrTexture. > >BUG=skia:5932 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4455 Change-Id: I4a9f4abac44979cb900f5b04fe741524eade66b1 Reviewed-on: https://skia-review.googlesource.com/4455 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Further centralize computation of GrSurface VRAM consumption - take 2Gravatar Robert Phillips2016-11-07
| | | | | | | | | | | This is the same as https://skia-review.googlesource.com/c/4383/ (Further centralize computation of GrSurface VRAM consumption) but with a suppression for Vulkan in the new test and removal of an assert Chromium was triggering. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4450 Change-Id: Ie87d32fd5f0d35c21326b066a0c733cb6f8a5bea Reviewed-on: https://skia-review.googlesource.com/4450 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Further centralize computation of GrSurface VRAM consumption"Gravatar Ben Wagner2016-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ccd3c8937fce4bb28df19533ed043cad209e277d. Reason for revert: Blocking Chromium roll: https://codereview.chromium.org/2482643002/ Original change's description: > Further centralize computation of GrSurface VRAM consumption > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4383 > > Change-Id: I054b74f2cd15f904f8e05af0fda58d6e8a523eb9 > Reviewed-on: https://skia-review.googlesource.com/4383 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=662630 Change-Id: I186db2a41eb2bd789e6f681b3547e32d9ca374cf Reviewed-on: https://skia-review.googlesource.com/4443 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
* Revert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear."Gravatar Ben Wagner2016-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4d53c44aa6e8e0d1b6537f83e4287e5a1423ac75. Reason for revert: Depends on https://skia-review.googlesource.com/c/4383/ which I need to revert. Original change's description: > Limit GL_TEXTURE_RECTANGLE filtering to bilinear. > > Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures. > > Also moves samplerType() to GrTexturePriv from GrTexture. > > BUG=skia:5932 > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4352 > > Change-Id: I1f023d4f4133e7eb393367580c0558257e56c8db > Reviewed-on: https://skia-review.googlesource.com/4352 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Chris Dalton <csmartdalton@google.com> > TBR=bsalomon@google.com,csmartdalton@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=662630 Change-Id: I012aa208594ccff0bb81bece8110a38e1f83ae00 Reviewed-on: https://skia-review.googlesource.com/4444 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
* tests: s/SkAutoTUnref/sk_sp/Gravatar Hal Canary2016-11-04
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4394 Change-Id: I088b3c6e2adff07abed1e8a50091cc0ec4a4109c Reviewed-on: https://skia-review.googlesource.com/4394 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Limit GL_TEXTURE_RECTANGLE filtering to bilinear.Gravatar Brian Salomon2016-11-04
| | | | | | | | | | | | | | | Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures. Also moves samplerType() to GrTexturePriv from GrTexture. BUG=skia:5932 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4352 Change-Id: I1f023d4f4133e7eb393367580c0558257e56c8db Reviewed-on: https://skia-review.googlesource.com/4352 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* Further centralize computation of GrSurface VRAM consumptionGravatar Robert Phillips2016-11-04
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4383 Change-Id: I054b74f2cd15f904f8e05af0fda58d6e8a523eb9 Reviewed-on: https://skia-review.googlesource.com/4383 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAMGravatar Mike Reed2016-11-03
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4384 Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0 Reviewed-on: https://skia-review.googlesource.com/4384 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Make more tests exercise rendertargetless textures.Gravatar Brian Salomon2016-11-03
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4322 Change-Id: I442041cd5d74768f0981eedcc17be7256e0e0b37 Reviewed-on: https://skia-review.googlesource.com/4322 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* GN: iOS basicsGravatar Mike Klein2016-11-03
| | | | | | | | | | | | | | | This doesn't create any apps or bundles or sign anything, but it all compiles and links. Note the awkward transitional hack I used to make each tool's tool_main() serve as the real main() again when built with GN, while keeping the existing setup with GYP. Fun... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4350 Change-Id: I632753d5d8e5848380854f413bf5905d676bfcf4 Reviewed-on: https://skia-review.googlesource.com/4350 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove SkAutoTDelete.Gravatar Ben Wagner2016-11-03
| | | | | | | | | Replace with std::unique_ptr. Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176 Reviewed-on: https://skia-review.googlesource.com/4381 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix quad convexity with only one backward dirGravatar liyuqian2016-11-03
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2465253008 Review-Url: https://codereview.chromium.org/2465253008
* Use temporary FBO for GrGLGpu::onReadPixels.Gravatar Brian Salomon2016-11-03
| | | | | | | | | | | | | Allow configs to be supported as FBO attachments for copies/readbacks without being "renderable" elsewhere in Ganesh. The motivation for this is to add support for int textures as srcs but not as dsts (at least initially) but to still be able to read them back. This means we don't pay for a unneeded GPU copy when reading back a GrSurface that is a GrTexture and not a GrRenderTarget. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4345 Change-Id: I824a73c6b8c1b9634206d76ccf0848d5f9b64441 Reviewed-on: https://skia-review.googlesource.com/4345 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove SkAutoTDeleteArrayGravatar Ben Wagner2016-11-02
| | | | | | | | | | | | This class is already just an alias for std::unique_ptr<T[]>, so replace all uses with that and delete the class. CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot Change-Id: I40668d398356a22da071ee791666c7f728b59266 Reviewed-on: https://skia-review.googlesource.com/4362 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Update ProxyTestsGravatar Robert Phillips2016-11-02
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4306 Change-Id: I0753047eeda71a22b6126f932fc14dd242c5a2e7 Reviewed-on: https://skia-review.googlesource.com/4306 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Back SkSpecialImage_Gpu with a GrTextureProxyGravatar Robert Phillips2016-11-02
| | | | | | | | | | | | | This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus)) The addition of the gpuMemorySize methods is for the SkSpecialImage cache. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4227 Change-Id: Ia9b9d42fb2a0caf61bbfa3ebcc84308c56f541fc Reviewed-on: https://skia-review.googlesource.com/4227 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Loosen restriction on F16 surfaces - allow "legacy" F16 modeGravatar Brian Osman2016-11-01
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4231 Change-Id: I032cdf82468ca11639760eb99773a88a5808ebe6 Reviewed-on: https://skia-review.googlesource.com/4231 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* fixed skslc's handling of ivec(vec)Gravatar Ethan Nicholas2016-11-01
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4222 Change-Id: I9b32067af51f3a04efa702cf2eb1ac1ed480df6a Reviewed-on: https://skia-review.googlesource.com/4222 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* hide setImageFilter(ptr)Gravatar Mike Reed2016-11-01
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4184 Change-Id: Iad792cfdf54087ad4c424fd268559c162a9a5f5c Reviewed-on: https://skia-review.googlesource.com/4184 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove GrStencilSettings from GrPipelineGravatar csmartdalton2016-11-01
| | | | | | | | | | | | | | | | Updates the GrPipeline to have user stencil settings instead of actual settings. This allows us to further defer creating and attaching a stencil buffer. This change is a partial step. The ultimate goal is to attach the stencil buffer and create the stencil settings during render target flush, but for the sake of keeping this CL smaller, we create the stencil settings right before use for now. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468653002 Review-Url: https://codereview.chromium.org/2468653002
* Report repetition count in SkCodecGravatar scroggo2016-11-01
| | | | | | | | | | | | | | | | | | | | | Add a new accessor to retrieve the repetition count. Remove constants (and corresponding copyright) in SkCodecAnimation. These may make sense for the calling code, but are not needed here. kRepetitionCountInfinite corresponds to Blink's kAnimationLoopInfinite. Move cLoopCountNotSeen to private. It is used to determine whether we still need to parse. Add a new enum to the parse query - only parse enough to determine the repetition count. Unlike Chromium, SkGifCodec does not account for deleting the reader (which SkGifCodec does not do) or failed decodes. Add a test. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447863002 Review-Url: https://codereview.chromium.org/2447863002
* Use correct color table for prior GIF framesGravatar Leon Scroggins III2016-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | While investigating skbug.com/5883 I noticed that we use the color table for the current frame even while recursively decoding frames that the current frame depends on. This CL updates fCurrColorTable, fCurrColorTableIsReal and fSwizzler before decoding prior frames, and then sets them back afterwards. Move telling the client about the color table into prepareToDecode, since the other callers do not need to do so. (That is only necessary for decoding to index 8, which is unsupported for frames with dependencies.) Add a test that exposes the bug. colorTables.gif has a local color table in its second frame that does not match the global table used by the first frame. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4208 Change-Id: Id2dc9e3283adfd92801d2f38726afa74574b1955 Reviewed-on: https://skia-review.googlesource.com/4208 Reviewed-by: Joost Ouwerling <joostouwerling@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add GrNextSizePow2Gravatar Robert Phillips2016-10-31
| | | | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4069 BUG=skia:5882 Change-Id: Ib9af5918716be594c3c07239eca179dbb4eb8566 Reviewed-on: https://skia-review.googlesource.com/4069 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Reject non-D50 matrices from ICC profilesGravatar Matt Sarett2016-10-31
| | | | | | | | | | | | BUG:660838 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4200 Change-Id: Ib57eb3705d6fe638e3a9cb56788937fc7e282847 Reviewed-on: https://skia-review.googlesource.com/4200 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* SkFixed15Gravatar Mike Klein2016-10-31
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3981 Change-Id: I811b22004e8e2d5b7135f574caea296ffdff7011 Reviewed-on: https://skia-review.googlesource.com/3981 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add isAlphaOnly() queryGravatar reed2016-10-31
| | | | | | | | | BUG=skia:5904 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2461773002 TBR= Review-Url: https://codereview.chromium.org/2461773002
* Change comments to refer to "render target context" rather than "draw context"Gravatar Brian Salomon2016-10-29
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4180 Change-Id: I553043ed576d0654faa68ed2e9e9978e4fc6476c Reviewed-on: https://skia-review.googlesource.com/4180 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* remove xfermode from public apiGravatar Mike Reed2016-10-28
| | | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac Reviewed-on: https://skia-review.googlesource.com/4020 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove unneeded SkColorSpace constructorGravatar Matt Sarett2016-10-28
| | | | | | | | | | | | | TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4140 Change-Id: Ib1c477b6b56a100ea449ffa20bdf18041c044a78 Reviewed-on: https://skia-review.googlesource.com/4140 Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add tests for ColorSpacePrimaries to XYZD50Gravatar Matt Sarett2016-10-28
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4146 Change-Id: I6725b3ae61b0db55b09a025e4cccd22046e6f056 Reviewed-on: https://skia-review.googlesource.com/4146 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Make GrDrawContext be GrRenderTargetProxy-backedGravatar Robert Phillips2016-10-28
| | | | | | | | | | | | | This is split out of https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus)) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3841 CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-GN_Android-Trybot Change-Id: I1a47f19ed1ac0c249e6ccac8db74095d7f456db4 Reviewed-on: https://skia-review.googlesource.com/3841 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Reduced skslc memory consumptionGravatar ethannicholas2016-10-28
| | | | | | | | | | | | The big change here is smarter generic type handling which allows us to keep far fewer entries in the core symboltable. This also comments out a number of OpenGL builtin functions which Skia does not use and is unlikely to in the future. BUG=655673 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2442063002 Committed: https://skia.googlesource.com/skia/+/cffaa70896fa5bc6c7bf98abbaafb1a755b49762 Review-Url: https://codereview.chromium.org/2442063002
* Rename renderTargetContextPriv to priv, and some more leftover DCsGravatar Brian Osman2016-10-27
| | | | | | | | | | | | | | | | API change is for non-public API. TBR=bsalomon@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4060 Change-Id: I5011d753c3c6d1145ff242eab6baff2ae0647ba3 Reviewed-on: https://skia-review.googlesource.com/4060 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Rename GrDrawContext to GrRenderTargetContextGravatar Brian Osman2016-10-27
| | | | | | | | | | | | | | This is in preparation for GrTextureContext and GrSurfaceContext BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030 Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd Reviewed-on: https://skia-review.googlesource.com/4030 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* chmod -x *.cpp *.hGravatar Hal Canary2016-10-27
| | | | | | | Change-Id: I5b37499505e26e0837921292c1aea0056e4d5ecd Reviewed-on: https://skia-review.googlesource.com/4035 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Remove SkAutoTUnref and SkAutoTDelete from public includes.Gravatar bungeman2016-10-27
| | | | | | | | | | | | | | | This also makes the required changed to src, tests, and tools. The few public APIs modified by this change appear to be unused outside of Skia. Removing these from the public API makes it easier to ensure users are no longer using them. This also updates GrGpu::wrapBackendXXX and the ::onWrapBackendXXX methods to clarify ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002 Review-Url: https://codereview.chromium.org/2448593002
* Revert of Reduced skslc memory consumption (patchset #3 id:50001 of ↵Gravatar benjaminwagner2016-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2442063002/ ) Reason for revert: texelFetch removed, but is used in some shaders. Original issue's description: > Reduced skslc memory consumption > > The big change here is smarter generic type handling which allows us to > keep far fewer entries in the core symboltable. This also comments out > a number of OpenGL builtin functions which Skia does not use and is > unlikely to in the future. > BUG=655673 > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2442063002 > > Committed: https://skia.googlesource.com/skia/+/cffaa70896fa5bc6c7bf98abbaafb1a755b49762 TBR=reed@google.com,ethannicholas@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=655673 Review-Url: https://codereview.chromium.org/2458723002
* Reduced skslc memory consumptionGravatar ethannicholas2016-10-27
| | | | | | | | | | | The big change here is smarter generic type handling which allows us to keep far fewer entries in the core symboltable. This also comments out a number of OpenGL builtin functions which Skia does not use and is unlikely to in the future. BUG=655673 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2442063002 Review-Url: https://codereview.chromium.org/2442063002
* Convert SkRasterPipeline loads and stores to indirect.Gravatar Mike Klein2016-10-26
| | | | | | | | | | | | | | | This allows us to change the underlying pointer without rebuilding the pipeline, e.g. when moving the blitter from scanline to scanline. The extra overhead when not needed is measurable but small, <2%. We can always add back direct stages later for cases where we know the context pointer will not change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3943 Change-Id: I827d7e6e4e67d02dd2802610f898f98c5f36f8cb Reviewed-on: https://skia-review.googlesource.com/3943 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Turn on -Wrange-loop-analysis.Gravatar Mike Klein2016-10-26
| | | | | | | | | | | | | | -Wrange-loop-analysis triggers when we use a new-style for loop in a way that appears to unintentionally call a copy constructor on each non-trivial loop element instead of operating on them by reference. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4000 Change-Id: If9e1b7fcc1f2789ae03c41c17abb17e60d564a8b Reviewed-on: https://skia-review.googlesource.com/4000 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* GrConstColorProcessor uses 4f colors in the destination spaceGravatar Brian Osman2016-10-26
| | | | | | | | | | | | | | | | | | | | Many places that construct one are explicitly specifying opaque white or transparent black, which we can assume (based on the semantics of the operation) should remain (0,0,0,0) or (1,1,1,1), so that's simple. In other cases, we convert our source color to destination space. One wrinkle is tht SkColorFilter now needs to know the destination color space, due to SkModeColorFilter. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3903 Change-Id: I4969c0260588f4021300733f601b47dc606adf79 Reviewed-on: https://skia-review.googlesource.com/3903 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* SkGifCodec: do not write off the end of memory when repeatCount > 1Gravatar Matt Sarett2016-10-26
| | | | | | | | | | | BUG=skia:5887 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3940 Change-Id: I9e3ed6153a73277896ac067ef73918a41a0546b8 Reviewed-on: https://skia-review.googlesource.com/3940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* SkRasterPipeline::compile().Gravatar Mike Klein2016-10-25
| | | | | | | | | | | I'm not yet caching these in the blitter, and speed is essentially unchanged in the bench where I am now building and compiling the pipeline only once. This may not be able to stay a simple std::function after I figure out caching, but for now it's a nice fit. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3911 Change-Id: I9545af589f73baf9f17cb4e6ace9a814c2478fe9 Reviewed-on: https://skia-review.googlesource.com/3911 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* fix fuzzGravatar caryclark2016-10-25
| | | | | | | | | | Abort early if fuzz data breaks intersection. R=kjlubick@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2444333002 Review-Url: https://codereview.chromium.org/2444333002
* remove discardablepixelrefGravatar Mike Reed2016-10-25
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3883 Change-Id: Ica284be78563a4ccd6e0cb07404064fb5511ba57 Reviewed-on: https://skia-review.googlesource.com/3883 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Include "SkBitmap.h" in CodecAnimTest.cppGravatar scroggo2016-10-24
| | | | | | | Fixes build GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2449513002 Review-Url: https://codereview.chromium.org/2449513002
* Add support for multiple frames in SkCodecGravatar scroggo2016-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an interface to decode frames beyond the first in SkCodec, and add an implementation for SkGifCodec. Add getFrameData to SkCodec. This method reads ahead in the stream to return a vector containing meta data about each frame in the image. This is not required in order to decode frames beyond the first, but it allows a client to learn extra information: - how long the frame should be displayed - whether a frame should be blended with a prior frame, allowing the client to provide the prior frame to speed up decoding Add a new fields to SkCodec::Options: - fFrameIndex - fHasPriorFrame The API is designed so that SkCodec never caches frames. If a client wants a frame beyond the first, they specify the frame in Options.fFrameIndex. If the client does not have the frame's required frame (the frame that this frame must be blended on top of) cached, they pass false for Options.fHasPriorFrame. Unless the frame is independent, the codec will then recursively decode all frames necessary to decode fFrameIndex. If the client has the required frame cached, they can put it in the dst they pass to the codec, and the codec will only draw fFrameIndex onto it. Replace SkGifCodec's scanline decoding support with progressive decoding, and update the tests accordingly. Implement new APIs in SkGifCodec. Instead of using gif_lib, use GIFImageReader, imported from Chromium (along with its copyright headers) with the following changes: - SkGifCodec is now the client - Replace blink types - Combine GIFColorMap::buildTable and ::getTable into a method that creates and returns an SkColorTable - Input comes from an SkStream, instead of a SegmentReader. Add SkStreamBuffer, which buffers the (potentially partial) stream in order to decode progressively. (FIXME: This requires copying data that previously was read directly from the SegmentReader. Does this hurt performance? If so, can we fix it?) - Remove UMA code - Instead of reporting screen width and height to the client, allow the client to query for it - Fail earlier if the first frame AND screen have size of zero - Compute required previous frame when adding a new one - Move GIFParseQuery from GIFImageDecoder to GIFImageReader - Allow parsing up to a specific frame (to skip parsing the rest of the stream if a client only wants the first frame) - Compute whether the first frame has alpha and supports index 8, to create the SkImageInfo. This happens before reporting that the size has been decoded. Add GIFImageDecoder::haveDecodedRow to SkGifCodec, imported from Chromium (along with its copyright header), with the following changes: - Add support for sampling - Use the swizzler - Keep track of the rows decoded - Do *not* keep track of whether we've seen alpha Remove SkCodec::kOutOfOrder_SkScanlineOrder, which was only used by GIF scanline decoding. Call onRewind even if there is no stream (SkGifCodec needs to clear its decoded state so it will decode from the beginning). Add a method to SkSwizzler to access the offset into the dst, taking subsetting into account. Add a GM that animates a GIF. Add tests for the new APIs. *** Behavior changes: * Previously, we reported that an image with a subset frame and no transparent index was opaque and used the background index (if present) to fill the background. This is necessary in order to support index 8, but it does not match viewers/browsers I have seen. Examples: - Chromium and Gimp render the background transparent - Firefox, Safari, Linux Image Viewer, Safari Preview clip to the frame (for a single frame image) This CL matches Chromium's behavior and renders the background transparent. This allows us to have consistent behavior across products and simplifies the code (relative to what we would have to do to continue the old behavior on Android). It also means that we will no longer support index 8 for some GIFs. * Stop checking for GIFSTAMP - all GIFs should be either 89a or 87a. This matches Chromium. I suspect that bugs would have been reported if valid GIFs started with "GIFVER" instead of "GIF89a" or "GIF87a" (but did not decode in Chromium). *** Future work not included in this CL: * Move some checks out of haveDecodedRow, since they are the same for the entire frame e.g. - intersecting the frameRect with the full image size - whether there is a color table * Change when we write transparent pixels - In some cases, Chromium deemed this unnecessary, but I suspect it is slower than the fallback case. There will continue to be cases where we should *not* write them, but for e.g. the first pass where we have already cleared to transparent (which we may also be able to skip) writing the transparent pixels will not make anything incorrect. * Report color type and alpha type per frame - Depending on alpha values, disposal methods, frame rects, etc, subsequent frames may have different properties than the first. * Skip copies of the encoded data - We copy the encoded data in case the stream is one that cannot be rewound, so we can parse and then decode (possibly not immediately). For some input streams, this is unnecessary. - I was concerned this cause a performance regression, but on average the new code is faster than the old for the images I tested [1]. - It may cause a performance regression for Chromium, though, where we can always move back in the stream, so this should be addressed. Design doc: https://docs.google.com/a/google.com/document/d/12Qhf9T92MWfdWujQwCIjhCO3sw6pTJB5pJBwDM1T7Kc/ [1] https://docs.google.com/a/google.com/spreadsheets/d/19V-t9BfbFw5eiwBTKA1qOBkZbchjlTC5EIz6HFy-6RI/ GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2045293002 Review-Url: https://codereview.chromium.org/2045293002
* nc seal breaks simplifyGravatar caryclark2016-10-24
| | | | | | | | | | | | | | | This test has nearly coincident lines that are missorted. The underlying bug is caused when a pair of curves are coincident when reduced to line segments, but the end points aren't detected. The error was generated by running nanobench over all svg sample data with the distance field patch installed. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2440043003 Review-Url: https://codereview.chromium.org/2440043003
* Rename all color space factories from New* to Make*Gravatar Brian Osman2016-10-24
| | | | | | | | | | | | | | | | | | | | | Matches our naming convention for all other types - factories that return sk_sp (or any type that intelligently manages its own lifetime) are named Make. Previous factories are still around, assuming SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES is defined. Enable that define for Android, etc. See also: https://codereview.chromium.org/2442053002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3822 Change-Id: Iaea9376490736b494e8ffc820831f052bbe1478d Reviewed-on: https://skia-review.googlesource.com/3822 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>