aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* 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>
* Add recipe support for Pixel and Pixel XL.Gravatar Ben Wagner2016-10-26
| | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3964 Change-Id: I782ef741838860bfeace13c335f9a82403047220 Reviewed-on: https://skia-review.googlesource.com/3964 Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* Start inverting GN reading .gypis to GYP reading .gnis.Gravatar Mike Klein2016-10-26
| | | | | | | | | | | | | | This canaries the idea by converting gyp/pdf.gypi to gn/pdf.gni. If this lands and rolls quietly, I'll flesh out the rest. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3972 Change-Id: Iecaf1ccce7891679904c585946272bfb25eea299 Reviewed-on: https://skia-review.googlesource.com/3972 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Create GrTextureOpList to support deferred copy batches for texturesGravatar Brian Osman2016-10-26
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3967 Change-Id: I63b926f63294795f999a130c0ceead87fbaf978d Reviewed-on: https://skia-review.googlesource.com/3967 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add disableStencil method to GrGLGpuGravatar csmartdalton2016-10-26
| | | | | | | | | | | | Most the calls to flushStencil were just trying to disable it. This change cleans up that code so it can just call "disableStencil" instead of having to muck with GrStencilSettings. It should also make those calls slightly faster. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2453793002 Review-Url: https://codereview.chromium.org/2453793002
* GN: spin off :no_exceptions as its own config.Gravatar Mike Klein2016-10-26
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4001 Change-Id: Ibaa10b9b6f566958b7e6622eedbc30a7010260b3 Reviewed-on: https://skia-review.googlesource.com/4001 Reviewed-by: Kevin Lubick <kjlubick@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>
* Revert of Generate Signed Distance Field directly from vector path (patchset ↵Gravatar bsalomon2016-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | #19 id:360001 of https://codereview.chromium.org/1643143002/ ) Reason for revert: Chrome crash Original issue's description: > Generate Signed Distance Field directly from vector path > > Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002 > > Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f > Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549 > Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268 TBR=jvanverth@google.com,mtklein@google.com,wasim.abbas@arm.com,caryclark@google.com,reed@google.com,joel.liang@arm.com # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia: Review-Url: https://codereview.chromium.org/2447403002
* Remove skia.conf from .gitignoreGravatar Brian Osman2016-10-26
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3962 Change-Id: I2b4d9afda4a5cb393a52f34070ede03da170ee74 Reviewed-on: https://skia-review.googlesource.com/3962 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Build for Android from Windows, work in progress.Gravatar Mike Klein2016-10-26
| | | | | | | | | | | | | | | | | Pretty vanilla stuff here, mostly just making the gcc-like toolchain Windows friendly. I was having trouble getting rm -r {{output}} && $ar rcs {{output}} @$rspfile to work without deleting my ar.exe, so I chickened out the usual way by adding gn/ar.py. I've also updated bin/droid to work with Git Bash on Windows. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3751 Change-Id: I04c34ccc91e6a291c11ac4e7a7a0ffe41d879fe6 Reviewed-on: https://skia-review.googlesource.com/3751 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix some Windows warningsGravatar Jim Van Verth2016-10-26
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3980 Change-Id: Icfc5dfb985b966c625d9bc81f61719ac5549085e Reviewed-on: https://skia-review.googlesource.com/3980 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Add GrOpList and rename GrDrawTarget to GrRenderTargetOpListGravatar Robert Phillips2016-10-26
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3910 Change-Id: I026aa26ecc61a0d002e98892dca728536259e8b1 Reviewed-on: https://skia-review.googlesource.com/3910 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* 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>
* Remove SK_IGNORE_GL_TEXTURE_TARGET.Gravatar Ben Wagner2016-10-26
| | | | | | | | | | | This code was added with "Use a struct for client GL texture handles" https://codereview.chromium.org/1429863009. This define no longer appears to be set anywhere, so it and the code it guards can be removed. Change-Id: I80bb2a77b1f076143851c1d112937221eff2111a Reviewed-on: https://skia-review.googlesource.com/3902 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Ben Wagner <bungeman@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>
* GIF: Fill the frame if we have a dummy color tableGravatar scroggo2016-10-25
| | | | | | | | | | | | Since we will not draw anything later, we need to fill the frame with the fill color. NOTREECHECKS=true BUG=skia:5883 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2450943002 Review-Url: https://codereview.chromium.org/2450943002
* SK_FIX_BUILDGravatar scroggo2016-10-25
| | | | | | | | | NOTRY=true NOTREECHECKS=true TBR=mtklein@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447223002 Review-Url: https://codereview.chromium.org/2447223002
* Always use a color table with 256 colorsGravatar scroggo2016-10-25
| | | | | | | | | | | | | | | | | | Speculative fix for skbug.com/5883 We are hitting an assert (which I have not been able to repro - still need to get the skp that triggers it) because we are trying to read beyond the end of the color table. We use 8-bit indices, so 256 should be enough to prevent going beyond the end. There is only one case when we use a smaller color table - when it is a dummy. Make the dummy full size. NOTREECHECKS=true BUG=skia:5883 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2452673002 Review-Url: https://codereview.chromium.org/2452673002
* Do not exclude Gif on iOSGravatar scroggo2016-10-25
| | | | | | | | | | We no longer depend on an external library, so there is no reason to exclude it. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447973004 NOTREECHECKS=true Review-Url: https://codereview.chromium.org/2447973004
* Fix more namespace conflicts in SkGifImageReaderGravatar scroggo2016-10-25
| | | | | | | | | | To fix Google3 TBR=benjaminwagner@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2450753003 NOTREECHECKS=true Review-Url: https://codereview.chromium.org/2450753003
* 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>
* Move SkRasterPipeline further into SkOpts.Gravatar Mike Klein2016-10-25
| | | | | | | | | | | | | | | | | | The portable code now becomes entirely focused on enum+ptr descriptions, leaving the concrete implementation of the pipeline to SkOpts::run_pipeline(). As implemented, the concrete implementation is basically the same, with a little more type safety. Speed is essentially unchanged on my laptop, and that's having run_pipeline() rebuild its concrete state every call. There's room for improvement there if we split this into a compile_pipeline() / run_pipeline() sort of thing, which is my next planned CL. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3920 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: Ie4c554f51040426de7c5c144afa5d9d9d8938012 Reviewed-on: https://skia-review.googlesource.com/3920 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix dimensions and color-spin in color4shader GMGravatar Brian Osman2016-10-25
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3907 Change-Id: I0f263d98f942eda07eec4dabfec484461f77f83d Reviewed-on: https://skia-review.googlesource.com/3907 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Mac GN doc.Gravatar Mike Klein2016-10-25
| | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3906 NOTRY=true DOCS_PREVIEW= https://skia.org/?cl=3906 Change-Id: I1ad13dd5b7df3d76f99f11e02f04169c5b37ce95 Reviewed-on: https://skia-review.googlesource.com/3906 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* bin/sync: call fetch-gn when DEPS changesGravatar Hal Canary2016-10-25
| | | | | | | Change-Id: Ifb2a364df1a8817152a2c1e79748d14534a9e523 Reviewed-on: https://skia-review.googlesource.com/3904 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com>
* 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
* Fix GPU sRGB mode in viewerGravatar Brian Osman2016-10-25
| | | | | | | | | | | | | Need to attach the sRGB color space to the surface to get past validation. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3905 Change-Id: Icce1c8cf35c31023c116cbcddf8848c4c92cd212 Reviewed-on: https://skia-review.googlesource.com/3905 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* DM: JSON Debug SinkGravatar Hal Canary2016-10-25
| | | | | | | | | | | | | | | | | | Currently, the following GMs crash the debug canvas: ~dont_clip_to_layer ~imageblur ~imagefilterscropped ~pictureimagefilter ~savelayer_lcdtext ~textfilter_image // TODO(halcanary): fix this. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3742 Change-Id: Ieed3502119cd639fe345f3a41d436d5e39f3bdf1 Reviewed-on: https://skia-review.googlesource.com/3742 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com>
* 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>
* Generate Signed Distance Field directly from vector pathGravatar joel.liang2016-10-25
| | | | | | | | | | | Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002 Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549 Review-Url: https://codereview.chromium.org/1643143002
* Fix memory leak in FuzzGradientsGravatar kjlubick2016-10-25
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2446643003 Review-Url: https://codereview.chromium.org/2446643003
* DM: Draw image frames in a gridGravatar scroggo2016-10-25
| | | | | | | | | | | | Instead of drawing a large vertical strip for CodecSrc::kAnimated_Mode, draw a grid of images. Compute the grid based on the square root of the frame count, so the grid will be roughly square. BUG=skia:5881 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2445863002 Review-Url: https://codereview.chromium.org/2445863002
* Change recipes to use bot_updateGravatar borenet2016-10-25
| | | | | | | | NOTREECHECKS=true BUG=skia:5588 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448973002 Review-Url: https://codereview.chromium.org/2448973002
* Help msvs compile SkColorSpaceXform fasterGravatar Matt Sarett2016-10-24
| | | | | | | | | | | | | | Allowing MSVS to choose to not inline color_xform_RGBA will prevent the complexity from exploding. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3884 Change-Id: I31ab0754c6cc375d6d0e71ceb16afef1927bb4e3 Reviewed-on: https://skia-review.googlesource.com/3884 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Move third_party/gif's license into its own fileGravatar scroggo2016-10-24
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448573002 Review-Url: https://codereview.chromium.org/2448573002
* Differentiate animated image resultsGravatar scroggo2016-10-24
| | | | | | | | | | | | | | Prior to this CL, a kAnimated_Mode CodecSrc (which draws a strip of all frames in an image) has the same name as a non-animated one. This means that Gold compares the two. Someone triaging will see two very different images (a strip versus a single image) and think one of them is wrong. With this change, the two will have different names so they will not be compared with one another. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2446543003 Review-Url: https://codereview.chromium.org/2446543003
* Populate ALL copies of a command line flag during parsingGravatar Brian Osman2016-10-24
| | | | | | | | | | | | | | Now that we're declaring flags statically per-tool, we were only setting the value on one of them (randomly) in the linked list. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3881 Change-Id: I448cb7f42ee01a16daa65986b14aee9f1a2a3588 Reviewed-on: https://skia-review.googlesource.com/3881 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Rename GIFImageReader to SkGifImageReaderGravatar scroggo2016-10-24
| | | | | | | | The former could violate One Definition Rule in Google3, since other projects that are based on Chrome/webkit also have GIFImageReader. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2445653004 Review-Url: https://codereview.chromium.org/2445653004
* Add gif sources to public.bzl.Gravatar Ben Wagner2016-10-24
| | | | | | | | | | This also removes SK_HAS_GIF_LIBRARY since it does not appear in the code. Change-Id: I6e4d6ed560eb2877e6db61edf15f6be832166b44 Reviewed-on: https://skia-review.googlesource.com/3752 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Fix fuzzer's bools to be 0 or 1 onlyGravatar kjlubick2016-10-24
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447823002 Review-Url: https://codereview.chromium.org/2447823002
* Use SK_ALWAYS_INLINE in SkColorSpaceXformGravatar Matt Sarett2016-10-24
| | | | | | | | | | | | | | | | | | | Two reasons for this: (1) We care about the performance of this code, and Windows isn't very good at inlining. Let's make sure we isntruct the compiler to inline. (2) Since landing uses of this in Chrome, we're seeing flaky LayoutTests that appear to be timing related. I'm (very optimistically) hoping that this will help. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3744 Change-Id: Ibb6d9c4252c0b8ce62203fe65c7dd296248982c8 Reviewed-on: https://skia-review.googlesource.com/3744 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Clear background to white in animatedGif GMGravatar scroggo2016-10-24
| | | | | | | White looks the same in 565, reducing the number of differences in gold GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2447793002 Review-Url: https://codereview.chromium.org/2447793002
* 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
* Refactored SkColorSpace_A2B to allow arbitrary ordering of elementsGravatar raftias2016-10-24
| | | | | | | | | | | | | | | This is essential for representing non-lutAtoBType A2B tags such as lut16Type, lut8Type, mpet. Parsing of A2B0 tags was also moved ahead of the TRC/XYZ-matrix parsing, as profiles examined with both tags either had the TRC/XYZ tags as a fall-back or were incorrectly displayed if only the TRC/XYZ tags were used. This was submitted alone to reduce CL size. Tests that will use these changes will be introduced in the subsequent CLs that add on lut8/16Type A2B0 parsing. We already have lut16Type test images and these have been tested locally, but require additional code not submitted yet for lut16Type ICC profile parsing and A2B colorspace xforms. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2444553002 Review-Url: https://codereview.chromium.org/2444553002
* Print what crashed DM on Android too.Gravatar Mike Klein2016-10-24
| | | | | | | | | | | | | | | | This doesn't print a backtrace, but it's better than nothing. By preserving the original signal handler and calling into that, we keep the Android system stack trace, visible in logcat, the "dump log" step on bots. Tested locally on Mac and Android by making an arbitrary GM segfault. BUG=skia:5876 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3860 Change-Id: Ia7a962ca50e09d370423a6106033e34c47d7643d Reviewed-on: https://skia-review.googlesource.com/3860 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkShader* refAs... to sk_sp<SkShader> makeAs...Gravatar Ben Wagner2016-10-24
| | | | | | | | | | | There appear to be no existing overriders of the refAs.. method outside Skia. Change-Id: Iab174e83023093b4d7fc0bd8907666b66ddb1eea Reviewed-on: https://skia-review.googlesource.com/3746 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Update trooper doc with chrome-infra chat.Gravatar Ben Wagner2016-10-24
| | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3745 NOTRY=true DOCS_PREVIEW= https://skia.org/?cl=3745 Change-Id: Icc9b52a7b4bc90f4ef8d8b952d49663f74104ba9 Reviewed-on: https://skia-review.googlesource.com/3745 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* 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
* fix a few more fuzzesGravatar caryclark2016-10-24
| | | | | | | | | | | | Minor changes to fix some fuzz conditions. A couple of ignored asserts when the data is fuzzy, and one fail condition when the underlying data has already been deleted. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2443243002 Review-Url: https://codereview.chromium.org/2443243002
* Fix RecreateSKPs recipe to correctly fail when the upload failsGravatar borenet2016-10-24
| | | | | | | BUG=skia:5879 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2446633002 Review-Url: https://codereview.chromium.org/2446633002