aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecTest.cpp
Commit message (Collapse)AuthorAge
...
* Add support for row-by-row jpeg encodingGravatar Matt Sarett2017-05-02
| | | | | | | | 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>
* Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag""Gravatar Matt Sarett2017-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0122af08f6af0dee490e1a4f35b552377d0d4753. Reason for revert: Fixed Android callsite Original change's description: > Revert "Delete copyTo(Allocator), hide copyTo() behind flag" > > This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971. > > Reason for revert: Looks like I missed something I was supposed to delete in Android. > > Original change's description: > > Delete copyTo(Allocator), hide copyTo() behind flag > > > > Replace uses of copyTo() in Skia. > > > > Bug: skia:6464 > > Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 > > Reviewed-on: https://skia-review.googlesource.com/14502 > > Commit-Queue: Matt Sarett <msarett@google.com> > > Reviewed-by: Mike Reed <reed@google.com> > > > > TBR=msarett@google.com,reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e > Reviewed-on: https://skia-review.googlesource.com/14602 > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,reviews@skia.org,reed@google.com Change-Id: I81659a820f79f1958fda23cb62513065b57db99d Reviewed-on: https://skia-review.googlesource.com/14640 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Delete copyTo(Allocator), hide copyTo() behind flag"Gravatar Matt Sarett2017-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971. Reason for revert: Looks like I missed something I was supposed to delete in Android. Original change's description: > Delete copyTo(Allocator), hide copyTo() behind flag > > Replace uses of copyTo() in Skia. > > Bug: skia:6464 > Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 > Reviewed-on: https://skia-review.googlesource.com/14502 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=msarett@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e Reviewed-on: https://skia-review.googlesource.com/14602 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Delete copyTo(Allocator), hide copyTo() behind flagGravatar Matt Sarett2017-04-27
| | | | | | | | | | Replace uses of copyTo() in Skia. Bug: skia:6464 Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 Reviewed-on: https://skia-review.googlesource.com/14502 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
* SkPngCodec: Do not return kInvalidConversion on corrupt pngGravatar Matt Sarett2017-04-26
| | | | | | | | | | | In this case, the fuzzer thinks there is a bug because we are returning kInvalidConversion for a corrupt png file. Bug: skia:6550 Change-Id: I33f588442f5eaa8a4d642e9328750779f9a9ef5d Reviewed-on: https://skia-review.googlesource.com/14324 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Switch SkCodec to int for counts and indicesGravatar Leon Scroggins III2017-04-17
| | | | | | | | | | | | This matches other Skia APIs. size_t was adopted from blink/ GIFImageReader. Change-Id: Ic83e59f0942f597c4fb834e623acd9886ad483fe Reviewed-on: https://skia-review.googlesource.com/13274 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Chris Blume <cblume@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* hide lockpixels api behind flagGravatar Mike Reed2017-04-17
| | | | | | | | | | | | | | guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS needs https://codereview.chromium.org/2820873002/# to land first Bug: skia:6481 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Reviewed-on: https://skia-review.googlesource.com/13580 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Manual revert: Add support for writing ICC profiles to webp encoder"Gravatar Matt Sarett2017-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4293a1e5f259cf12560d6e794c1a05ad4dbc0b32. Reason for revert: Relanding, libwebp updated in Android master Original change's description: > Manual revert: Add support for writing ICC profiles to webp encoder > > Bug: skia: > Change-Id: I4e70bee8c2ea8dbd5ae1e84aa097f5a7e2e62721 > Reviewed-on: https://skia-review.googlesource.com/11444 > Reviewed-by: Matt Sarett <msarett@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I73aa9e8183241ada4ec6451567bce3d3d18995cc Reviewed-on: https://skia-review.googlesource.com/11523 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Manual revert: Add support for writing ICC profiles to webp encoderGravatar Matt Sarett2017-04-06
| | | | | | | | | Bug: skia: Change-Id: I4e70bee8c2ea8dbd5ae1e84aa097f5a7e2e62721 Reviewed-on: https://skia-review.googlesource.com/11444 Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* SkImageEncoder: Be more lenient on inputsGravatar Matt Sarett2017-04-05
| | | | | | | | | | | | | | | | | | | | (1) Some clients want us to write ICC profiles, even though they have not opted into linear unpremultiplication. This CL allows that behavior. (2) We should not assert that the transfer function must be linear or srgb. Particularly in non-linear blending modes, skia is willing to support a larger set of transfer functions. (3) We still need to require linear or srgb when in kRespect transfer function mode. We have not yet implemented linear unpremultiplies for arbitrary transfer functions. Bug: skia: Change-Id: Idce9f07c3d36eca4d78ede5e2650b2cab412904c Reviewed-on: https://skia-review.googlesource.com/11349 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Revert "Revert "Add support for writing ICC profiles to webp encoder""Gravatar Matt Sarett2017-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e87d7781db75a7ec22a103eda0886c2ca8dc4d9d. Reason for revert: Not the cause of the crashes. Original change's description: > Revert "Add support for writing ICC profiles to webp encoder" > > This reverts commit 0c9d0b4e03b6c10778329e995b5dfdcb97954b28. > > Reason for revert: Looks like it's breaking a number of bots. > > Original change's description: > > Add support for writing ICC profiles to webp encoder > > > > Bug: skia: > > Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab > > Reviewed-on: https://skia-review.googlesource.com/10212 > > Commit-Queue: Matt Sarett <msarett@google.com> > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > > > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: Ic06ad9f19a4d743b34f8d3bd33f171b9d74badcb > Reviewed-on: https://skia-review.googlesource.com/11408 > Reviewed-by: Jim Van Verth <jvanverth@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> > TBR=jvanverth@google.com,msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I42f6ddefaf87c87b155640950b52a456952130ec Reviewed-on: https://skia-review.googlesource.com/11410 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add support for writing ICC profiles to webp encoder"Gravatar Jim Van Verth2017-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0c9d0b4e03b6c10778329e995b5dfdcb97954b28. Reason for revert: Looks like it's breaking a number of bots. Original change's description: > Add support for writing ICC profiles to webp encoder > > Bug: skia: > Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab > Reviewed-on: https://skia-review.googlesource.com/10212 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic06ad9f19a4d743b34f8d3bd33f171b9d74badcb Reviewed-on: https://skia-review.googlesource.com/11408 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Add support for writing ICC profiles to webp encoderGravatar Matt Sarett2017-04-05
| | | | | | | | Bug: skia: Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab Reviewed-on: https://skia-review.googlesource.com/10212 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Revert[4] "clean up (partially) colortable api""""Gravatar Mike Reed2017-04-03
| | | | | | | | | | | | | | Fixes: - create temp api for android to pass nullptr - don't release and access sk_sp<SkData> at the same time in parameters This reverts commit b14131c1851eea6acbd34cc42a8f860daed36b21. Bug: skia: Change-Id: Ic0e4f62520ba9f35455499ed30d306ad19d998a8 Reviewed-on: https://skia-review.googlesource.com/11129 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Revert[2] "clean up (partially) colortable api"""Gravatar Mike Reed2017-04-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9920b10f5292838f00600f676c4578cd11705e60. Reason for revert: trying to get details on w2k failure https://chromium-swarm.appspot.com/task?id=354345d34ba3b310&refresh=10 Caught exception 3221225477 EXCEPTION_ACCESS_VIOLATION, was running: unit test HugeBlurImageFilter unit test FontNames unit test Codec_PngRoundTrip unit test ClampRange unit test FontHost unit test ColorMatrixFilter f16 image scaled_codec_premul abnormal.wbmp 565 image brd_android_codec_divisor_0.167 interlaced3.png_0.167 unit test Codec_png unit test ImageFilterBlurLargeImage unit test FontObj unit test DrawText unit test GrShape 565 image brd_android_codec_divisor_0.333 interlaced2.png_0.333 unit test PathOpsOpCubicsThreaded unit test PathOpsOpLoopsThreaded unit test FontMgr unit test ColorToHSVRoundTrip unit test Image_Serialize_Encoding_Failure Likely culprit: unit test Image_Serialize_Encoding_Failure step returned non-zero exit code: -1073741819 Original change's description: > Revert[2] "clean up (partially) colortable api"" > > This reverts commit 1d1165ca6575e082b892c5460492c411618783ad. > > Bug: skia: > Change-Id: Idbc0634ae3cec2e79f592d252de8751b077e6408 > Reviewed-on: https://skia-review.googlesource.com/11024 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia4e73434b083224baa36092c69526c2f59bb16aa Reviewed-on: https://skia-review.googlesource.com/11025 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert[2] "clean up (partially) colortable api""Gravatar Mike Reed2017-04-01
| | | | | | | | | | This reverts commit 1d1165ca6575e082b892c5460492c411618783ad. Bug: skia: Change-Id: Idbc0634ae3cec2e79f592d252de8751b077e6408 Reviewed-on: https://skia-review.googlesource.com/11024 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "clean up (partially) colortable api"Gravatar Mike Klein2017-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2e491a6a113c5e16a3b7bede5fa6f588deeb928d. Reason for revert: Windows unit tests failing? Original change's description: > clean up (partially) colortable api > > Needs this to land: https://codereview.chromium.org/2789853002/ > > Bug: skia: > Change-Id: I38d916a546b7fa64d000d973e695ddda24a589e7 > Reviewed-on: https://skia-review.googlesource.com/10600 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,scroggo@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I626e7edfcea82576a440dcaa851a04cedee6233f Reviewed-on: https://skia-review.googlesource.com/10966 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* clean up (partially) colortable apiGravatar Mike Reed2017-03-31
| | | | | | | | | | Needs this to land: https://codereview.chromium.org/2789853002/ Bug: skia: Change-Id: I38d916a546b7fa64d000d973e695ddda24a589e7 Reviewed-on: https://skia-review.googlesource.com/10600 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Add SkTransferFunctionBehavior flag: Use in codec and encoderGravatar Matt Sarett2017-03-24
| | | | | | | | | | | | | | This is a step towards removing the non-linear blending flag from SkColorSpace. The flag on SkColorSpace used to control the premul behavior - now it is controlled by this option. BUG=skia: Change-Id: Ia29bd8c2b0596a93c6aa14332dcd9bd39e388a90 Reviewed-on: https://skia-review.googlesource.com/10008 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Revert "Add support for writing icc profiles to the jpeg encoder""Gravatar Matt Sarett2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dda14b9b7ac13dba9214f484fc6270b3ccf4b68b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Add support for writing icc profiles to the jpeg encoder" > > This reverts commit 4ef01482025e2e629e35458aa214436d3b4138e8. > > Reason for revert: This breaks the android autoroller. > > Original change's description: > > Add support for writing icc profiles to the jpeg encoder > > > > Also, share the impl for skjpeg_error_mgr between the > > jpeg decoder and encoder. They are already identical > > anyway. > > > > BUG=skia: > > > > Change-Id: I4d67f28126388fef3057d62b6e0b203e21ed4afb > > Reviewed-on: https://skia-review.googlesource.com/10011 > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > Commit-Queue: Matt Sarett <msarett@google.com> > > > > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Change-Id: Idbb9918370e8384e39d6b7d1c3bcd9545ce4cfd1 > Reviewed-on: https://skia-review.googlesource.com/10017 > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Commit-Queue: Derek Sollenberger <djsollen@google.com> > TBR=djsollen@google.com,msarett@google.com,scroggo@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I9c1df3f497a9187ac017e464976fd8f0333bad0e Reviewed-on: https://skia-review.googlesource.com/10030 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add support for writing icc profiles to the jpeg encoder"Gravatar Derek Sollenberger2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4ef01482025e2e629e35458aa214436d3b4138e8. Reason for revert: This breaks the android autoroller. Original change's description: > Add support for writing icc profiles to the jpeg encoder > > Also, share the impl for skjpeg_error_mgr between the > jpeg decoder and encoder. They are already identical > anyway. > > BUG=skia: > > Change-Id: I4d67f28126388fef3057d62b6e0b203e21ed4afb > Reviewed-on: https://skia-review.googlesource.com/10011 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: Idbb9918370e8384e39d6b7d1c3bcd9545ce4cfd1 Reviewed-on: https://skia-review.googlesource.com/10017 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Add support for writing icc profiles to the jpeg encoderGravatar Matt Sarett2017-03-22
| | | | | | | | | | | | | Also, share the impl for skjpeg_error_mgr between the jpeg decoder and encoder. They are already identical anyway. BUG=skia: Change-Id: I4d67f28126388fef3057d62b6e0b203e21ed4afb Reviewed-on: https://skia-review.googlesource.com/10011 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add support for writing icc profiles to the jpeg encoder"Gravatar Derek Sollenberger2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e3b95ce468c73af8247ba9582a7b84548b19f06a. Reason for revert: This is breaking the Android auto roller. Original change's description: > Add support for writing icc profiles to the jpeg encoder > > Also, share the impl for skjpeg_error_mgr between the > jpeg decoder and encoder. They are already identical > anyway. > > BUG=skia: > > Change-Id: I029312406dee8734744cc3058acd1f153aefcd83 > Reviewed-on: https://skia-review.googlesource.com/9971 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,scroggo@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I05fb02610dbf4d9475f158d876d6495b0f7e9db4 Reviewed-on: https://skia-review.googlesource.com/10009 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Add support for writing icc profiles to the jpeg encoderGravatar Matt Sarett2017-03-22
| | | | | | | | | | | | | Also, share the impl for skjpeg_error_mgr between the jpeg decoder and encoder. They are already identical anyway. BUG=skia: Change-Id: I029312406dee8734744cc3058acd1f153aefcd83 Reviewed-on: https://skia-review.googlesource.com/9971 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add support for writing ICC profiles in png encodesGravatar Matt Sarett2017-03-21
| | | | | | | | | BUG=skia: Change-Id: I99eb2f157f249ed09d724461ec4a1e31db70816a Reviewed-on: https://skia-review.googlesource.com/9782 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Set a limit on the size for BMP imagesGravatar Leon Scroggins III2017-02-24
| | | | | | | | | | | | | | | This limit matches the limit used by Chromium. I am not aware of any real world BMPs that are larger than this (or even close to it), but there are some invalid BMPs that are larger than this, leading to crashes when we try to read a row. BUG:34778578 BUG=skia:3617 Change-Id: I0f662e8d0d7bc0b084e86d0c9288b831e1b296d7 Reviewed-on: https://skia-review.googlesource.com/8966 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* return and take SkImageGenerator as unique_ptrGravatar Mike Reed2017-02-15
| | | | | | | | | | BUG=skia: Change-Id: I4bc11042dd1dbf1eabd40af206027bc65acc3186 Reviewed-on: https://skia-review.googlesource.com/8444 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Reland "Respect canvas size and frame offset in webp decoder"Gravatar Matt Sarett2017-02-07
| | | | | | | | | | | | | | Original Change Reviewed At: https://skia-review.googlesource.com/c/7800 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN BUG=skia:6185 Change-Id: I1a7732832d37920545c1775d7c7c65b43ed810f9 Reviewed-on: https://skia-review.googlesource.com/8157 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Reland "Respect canvas size and frame offset in webp decoder""Gravatar Matt Sarett2017-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 604971e39a20392fd4c74a56bcdc187311cf86dc. Reason for revert: Strange vk failures Original change's description: > Reland "Respect canvas size and frame offset in webp decoder" > > Original Change Reviewed At: > https://skia-review.googlesource.com/c/7800 > > CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN > > BUG=skia:6185 > > Change-Id: I92baa9070e15ef3c62dd347c08c906c2715dda10 > Reviewed-on: https://skia-review.googlesource.com/8050 > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6185 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN Change-Id: Ice93b62c55ea13fce83140567be16225ff0e2fdb Reviewed-on: https://skia-review.googlesource.com/8123 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Reland "Respect canvas size and frame offset in webp decoder"Gravatar Matt Sarett2017-02-06
| | | | | | | | | | | | | | Original Change Reviewed At: https://skia-review.googlesource.com/c/7800 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN BUG=skia:6185 Change-Id: I92baa9070e15ef3c62dd347c08c906c2715dda10 Reviewed-on: https://skia-review.googlesource.com/8050 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Respect canvas size and frame offset in webp decoder"Gravatar Robert Phillips2017-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0f33970c8d950a68b7d83cc626ac0500953d6b15. Reason for revert: msan complaint Original change's description: > Respect canvas size and frame offset in webp decoder > > BUG=skia:6185 > > Change-Id: Id543cb689a5e33b800ebbc18f4a234e78a4c4298 > Reviewed-on: https://skia-review.googlesource.com/7800 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=borenet@google.com,msarett@google.com,scroggo@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6185 Change-Id: Ie01dc7d7ebfebe36a235335d0d8cb28bccb2ecff Reviewed-on: https://skia-review.googlesource.com/8046 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Respect canvas size and frame offset in webp decoderGravatar Matt Sarett2017-02-03
| | | | | | | | | BUG=skia:6185 Change-Id: Id543cb689a5e33b800ebbc18f4a234e78a4c4298 Reviewed-on: https://skia-review.googlesource.com/7800 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Do not crash when the resources are missingGravatar Leon Scroggins III2017-01-30
| | | | | | | | | | | In test_conversion_possible BUG=skia:5314 Change-Id: Ia0e4178a262820b4161e55e07b0669f18322a64b Reviewed-on: https://skia-review.googlesource.com/7742 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Set fOptions in SkCodec::getPixelsGravatar Leon Scroggins III2017-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Subclasses sometimes try to read fOptions, but it used to not get set for full decodes. As a result, they might be reading the Options from a previous scanline/incremental decode. In addition to being wrong, this is bad in the case of an fSubset pointing to a rectangle that no longer exists. So set fOptions in getPixels, prior to any attempts to read it by sub- classes. Use a different workaround for the webp/incomplete bug. Set fSubset to null prior to calling fillIncompleteImage. It can only be non-null for webp, and in that case we do not want the fill call to be using the subset width. Modify the Codec_jpeg_rewind test to use an incomplete image, so that it will also test fillIncompleteImage. DM tests of inc0.webp and inc1.webp will verify that the incomplete bug has not resurfaced. BUG=skia:5772 Change-Id: If5e1e3c9a7f337183783299c0a9e58dcbbc84119 Reviewed-on: https://skia-review.googlesource.com/7682 Commit-Queue: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Add test for bad reuse of SkJpegCodec internal stateGravatar Matt Sarett2017-01-25
| | | | | | | | | | | | This is a test for the following fix: https://skia-review.googlesource.com/c/7451/ b/34637813 Change-Id: I3fdb0d7d50537948039b75c3a22454e789ca810a Reviewed-on: https://skia-review.googlesource.com/7454 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Use fixed size buffer for RLE bmpsGravatar Leon Scroggins III2017-01-19
| | | | | | | | | | | | | | | | | | | | | | | An RLE bmp reports how many bytes it should contain. This number may be incorrect, or it may be a very large number. Previously, we buffered all bytes in a single allocation. Instead, use a fixed size buffer and only read what fits into the buffer. We already have code to refill the buffer if there is more data, so rely on that to keep reading. Choose an arbitrary size for the buffer. It is larger than the maximum possible number of bytes we need to read at once. Add a test with a test image that reports a very large number for the number of bytes it should contain. With the old method, we would allocate 4 gigs of memory to decode this image, which is unnecessary and may result in OOM. BUG=b/33251605 Change-Id: I6d66eace626002725f62237617140cab99ce42f3 Reviewed-on: https://skia-review.googlesource.com/7028 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'" This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da. Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab Reviewed-on: https://skia-review.googlesource.com/6886 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"Gravatar Kevin Lubick2017-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a5494f117086d712855e4b6289c58c92d1549bcf. Reason for revert: Broke Google3 Original change's description: > SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h > > * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). > > * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h > > * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" > > Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 > Reviewed-on: https://skia-review.googlesource.com/4543 > Reviewed-by: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5 Reviewed-on: https://skia-review.googlesource.com/6884 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 Reviewed-on: https://skia-review.googlesource.com/4543 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Update libwebp to v0.5.2-rc2Gravatar Leon Scroggins III2016-12-20
| | | | | | | | | | | | | This matches the version used by Chromium (crbug.com/675306) and Android (https://android-review.googlesource.com/#/c/316352/). Update our test. In the new version, we successfully decode a subset from incomplete input that we previously did not. Change-Id: I3442bf59ffdf223a723d8aa75f5b9b816b9e9c3c Reviewed-on: https://skia-review.googlesource.com/6320 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* GIF: Avoid copying/storing data when possibleGravatar Leon Scroggins III2016-12-19
| | | | | | | | | | | | | | | | | | | If the input SkStream has a length and position, do not copy and store LZW blocks or ColorMaps. Instead, mark the position and size, and read from the stream when necessary. This will save memory in Chromium's use case, which has already buffered all of its data. In the case where we *do* need to copy, store it on the SkStreamBuffer. This allows SkGifImageReader to have simpler code. Add tests. Change-Id: Ic65fa766328ae2e5974b2084bc2099e19aced731 Reviewed-on: https://skia-review.googlesource.com/6157 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Stop supporting kUnknown_BmpHeaderTypeGravatar Leon Scroggins III2016-12-15
| | | | | | | | | | | | | | | | | | | | | In SkBmpCodec, if the header size does not match a known header, stop trying to create an SkCodec. We do not know of any BMPs with arbitrarily sized headers, so this should not cause any real regressions. In addition, this fixes a bug where we attempt to read too much data from a file. Since we attempt to read the header size in one read, and a size reported by the "BMP" may be larger than SSIZE_MAX, this will crash when reading from a file. Add a test. BUG:b/33651913 Change-Id: I0f3292db3124dc5ac5cbdbc07196bda130a49ba7 Reviewed-on: https://skia-review.googlesource.com/6150 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* SkGifCodec: intersect frameRect with image sizeGravatar Leon Scroggins III2016-12-13
| | | | | | | | | | | | | | | When clearing due to SkCodecAnimation::RestoreBGColor_DisposalMethod, intersect the frameRect with the image size to prevent clearing outside the bounds of the allocated memory. Add a test image, created by the fuzzer. BUG=skia:6046 Change-Id: I43676d28f82abf093ef801752f3a9e881580924c Reviewed-on: https://skia-review.googlesource.com/5860 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Divide up CodecTestGravatar Leon Scroggins III2016-12-06
| | | | | | | | | | | | | | | | | Split up DEF_TEST(Codec, r) by type. Frequently when I am testing locally I only want to test one type (e.g. I am testing changes to SkGifCodec), and this allows me to skip past the ones I do not care about. It also speeds up my local runs, since most of the time is spent in this single long test. Splitting them up means they can run in parallel, halving run time. (Probably doesn't make a big difference on bots, where more tests are running.) Change-Id: Ic6babc20e1288dbb4fb255290f71523a033c7559 Reviewed-on: https://skia-review.googlesource.com/5622 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Do not create an SkRawCodec with zero dimensionsGravatar Leon Scroggins III2016-12-02
| | | | | | | | | | | | Add a test BUG=skia:3534 BUG=b/33300701 Change-Id: Ifb3a824a36998c5e626c4ad58466845f49d18ebf Reviewed-on: https://skia-review.googlesource.com/5568 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* SkImageEncoder: simplify APIGravatar Hal Canary2016-11-23
| | | | | | | | | | | | | | | | | | | | | | | | (re-land 248ff02 & 2cb6cb7, with changes) - Hide SkImageEncoder class in private header. - SkImageEncoder::Type becomes SkEncodedImageFormat - SkEncodedFormat becomes SkEncodedImageFormat - SkImageEncoder static functions replaced with single function EncodeImage() - utility wrappers for EncodeImage() are in sk_tool_utils.h TODO: remove link-time registration mechanism. TODO: clean up clients use of API and flip the flag. TODO: implement EncodeImage() in chromeium/skia/ext Change-Id: I47d451e50be4d5c6c130869c7fa7c2857243d9f0 Reviewed-on: https://skia-review.googlesource.com/4909 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-on: https://skia-review.googlesource.com/5186 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
* Revert 248ff023 & 2cb6cb72Gravatar Hal Canary2016-11-22
| | | | | | | | | | | | | | Revert "SkImageEncoder: simplify API" This reverts commit 248ff02331d7f73ee4b6c5a7eabeae1080c16cd4. Revert "Fix bug: can't convert nullptr -> bool" This reverts commit 2cb6cb7218171b357bb5c934f032ba69c7b78401. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151 NOTRY=true Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec Reviewed-on: https://skia-review.googlesource.com/5151 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
* SkImageEncoder: simplify APIGravatar Hal Canary2016-11-22
| | | | | | | | | | | | | | | | | | | | | | - Hide SkImageEncoder class in private header. - SkImageEncoder::Type becomes SkEncodedImageFormat - SkEncodedFormat becomes SkEncodedImageFormat - SkImageEncoder static functions replaced with single function EncodeImage() - utility wrappers for EncodeImage() are in sk_tool_utils.h TODO: remove link-time registration mechanism. TODO: clean up clients use of API and flip the flag. TODO: implement EncodeImage() in chromeium/skia/ext GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4909 Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70 Reviewed-on: https://skia-review.googlesource.com/4909 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Fail jpeg decodes on too many progressive scansGravatar Matt Sarett2016-11-08
| | | | | | | | | | | BUG:642462 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4560 Change-Id: I22891ce1e0b3a1bedefc34dadd5cf34dfc301b79 Reviewed-on: https://skia-review.googlesource.com/4560 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@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>