aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
Commit message (Collapse)AuthorAge
* Add support for webp lossless compressionGravatar Matt Sarett2017-05-17
| | | | | | | | | Bug: 713862 Change-Id: I8dcc6506338f3c54fb14a78620e7daaadadfedde Reviewed-on: https://skia-review.googlesource.com/17073 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Fix Ubuntu-Clang-x86_64-Release-MiniGravatar Matt Sarett2017-05-11
| | | | | | | | | | Bug: skia: Change-Id: Iab3dbb007ae67b5d82a727cb1fd5ced6b10b325a Reviewed-on: https://skia-review.googlesource.com/16605 Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add SkJpegEncoder and SkWebpEncoder to public APIGravatar Matt Sarett2017-05-11
| | | | | | | | | Bug: 713862 Change-Id: I05d8b3a506f817d63b0bc3ab3f9233e24bbe3be0 Reviewed-on: https://skia-review.googlesource.com/16233 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Add downsampling option to SkJpegEncoderGravatar Matt Sarett2017-05-09
| | | | | | | | Bug: 713862 Change-Id: Ibad6ecf836ccfd355499e1bace7bcd4ba772a97a Reviewed-on: https://skia-review.googlesource.com/15891 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Add jpeg encoder alpha handling optionGravatar Matt Sarett2017-05-09
| | | | | | | | | | | | | | | | | This instructs us on how to encode jpegs when the src image has alpha. The original behavior is to ignore the alpha channel. This CL adds the option to blend the pixels onto opaque black. Note that kBlendOnBlack and kIgnore are identical unless the input alpha type is kUnpremul. Bug: 713862 Bug: skia:1501 Change-Id: I4891c70bb0ccd83f7974c359bd40a2143b5c49ac Reviewed-on: https://skia-review.googlesource.com/15817 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Move SkPngEncoder into public APIGravatar Matt Sarett2017-05-09
| | | | | | | | | | Bug: 713862 Change-Id: I45068ed39affe41ffe0f29bf42c5ea1d9b0247ba Reviewed-on: https://skia-review.googlesource.com/15897 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add filtering and zlib-level options to SkPngEncoderGravatar Matt Sarett2017-05-08
| | | | | | | | | | Bug: skia:6409 Bug: 713862 Change-Id: If287e2bcad5af990fac11e9091305f45ec903dbf Reviewed-on: https://skia-review.googlesource.com/15647 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Stub encoding impls for clients without librariesGravatar Matt Sarett2017-05-05
| | | | | | | | Bug: skia: Change-Id: I447b071e50182a569af828dc7f62bf78f47f834d Reviewed-on: https://skia-review.googlesource.com/15644 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* SkEncoder: Rename files, change webp API, for consistencyGravatar Matt Sarett2017-05-05
| | | | | | | | Bug: skia: Change-Id: I3dd6feb3d5661dcad3d2388b4d01fa9d3bbb15bb Reviewed-on: https://skia-review.googlesource.com/15631 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add support for row-by-row png encodesGravatar Matt Sarett2017-05-05
| | | | | | | | | | Also adds a SkEncoder base class. Bug: 713862 Change-Id: Ia3f009cd9f376514f6c19396245fab3a43ae6536 Reviewed-on: https://skia-review.googlesource.com/15152 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add support for row-by-row jpeg encodingGravatar Matt Sarett2017-05-02
| | | | | | | | | | | Reland of: https://skia-review.googlesource.com/c/14641/ Bug: 713862 Change-Id: I9dca5ede4ebf569c5f80edcfb23a506b6cfa935e Reviewed-on: https://skia-review.googlesource.com/15144 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add support for row-by-row jpeg encoding"Gravatar Leon Scroggins2017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9b848d5749c5e34b56f927a3a3374c8ebafbd9db. Reason for revert: ASAN reports leaked memory [1]. Google3 reports a "delete size mismatch" [2], which I suspect is the same issue. [1] https://chromium-swarm.appspot.com/task?id=35e2c9fa9eac6310&refresh=10&show_raw=1 [2] https://test.corp.google.com/ui#cl=154838904&flags=CAMQBQ==&id=OCL:154838904:BASE:154839043:1493741642370:9c96115f&t=//chrome/skia/dm_wrapper:dm_wrapper Original change's description: > Add support for row-by-row jpeg encoding > > Bug: 713862 > Change-Id: I787b7c49662a00b89ae0ef35845dfbd6be3e6fb1 > Reviewed-on: https://skia-review.googlesource.com/14641 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=msarett@google.com,scroggo@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic5a8d67e0d4a7733662586055ceff086a2ab335d Reviewed-on: https://skia-review.googlesource.com/15140 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* 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 "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>
* 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>
* More png API compatibilityGravatar Matt Sarett2017-03-21
| | | | | | | | | BUG=skia: Change-Id: I71aa730b08b3eebd18d9651363bbcd816b8598fd Reviewed-on: https://skia-review.googlesource.com/9976 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Compatible use of png_set_iCCPGravatar Matt Sarett2017-03-21
| | | | | | | | | BUG=skia: Change-Id: Ie37b92fd5e0d2bc92ec7f2bf3e6f56d061bc30a2 Reviewed-on: https://skia-review.googlesource.com/9960 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Ben Wagner <benjaminwagner@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>
* Make header files idempotent; script to checkGravatar Hal Canary2017-02-13
| | | | | | | Change-Id: I960ded854e6bc7cdee029a7393cac2a686c41754 Reviewed-on: https://skia-review.googlesource.com/8308 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Refactor pixel conversion: premul and unpremulGravatar Matt Sarett2017-02-09
| | | | | | | | | | | Just going for simpler and more code sharing. BUG=skia: Change-Id: I84c20cd4dbb6950f7b4d0bc659c4b3b5a2af201c Reviewed-on: https://skia-review.googlesource.com/8287 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Update SkJPEGImageEncoderGravatar Matt Sarett2017-01-28
| | | | | | | | | | | | | | (1) Use libjpeg-turbo color space extensions when possible. (2) Use transform_scanline_procs when pre-libjpeg-turbo transformation are required. (3) Add support for Gray and F16. BUG=skia: Change-Id: I77b977cb8c9e0afc17d907dd73a1cf3f16539bcc Reviewed-on: https://skia-review.googlesource.com/7642 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Delete SkAutoTime from jpeg encoderGravatar Matt Sarett2017-01-26
| | | | | | | | | | | We use nanobench instead to measure encode performance. BUG=skia: Change-Id: I4f0b43b7e09f99967889e941cb6947433033006a Reviewed-on: https://skia-review.googlesource.com/7640 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Add F16 and gamma correct support to webp encoderGravatar Matt Sarett2017-01-24
| | | | | | | | | BUG=skia: Change-Id: Ib788466fa1e2bed26e7ffd8f03bee42930eae1d6 Reviewed-on: https://skia-review.googlesource.com/7425 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Move shader register setup to SkRasterPipelineBlitter.Gravatar Mike Klein2017-01-23
| | | | | | | | | | | | | | | | | | | | | We've been seeding the initial values of our registers to x+0.5,y+0.5, 1,0, 0,0,0,0 (useful values for shaders to start with) in all pipelines. This CL changes that to do so only when blitting, and only when we have a shader. The nicest part of this change is that SkRasterPipeline itself no longer needs to have a concept of y, or what x means. It just marches x through [x,x+n), and the blitter handles y and layers the meaning of "dst x coordinate" onto x. This ought to make SkSplicer a little easier to work with too. dm --src gm --config f16 srgb 565 all draws the same. Change-Id: I69d8c1cc14a06e5dfdd6a7493364f43a18f8dec5 Reviewed-on: https://skia-review.googlesource.com/7353 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Make SkWEBPImageEncoder use transform_scanline_procsGravatar Matt Sarett2017-01-23
| | | | | | | | | | | | This refactor will make it simple to add F16 and GammaCorrect support to the webp encoder. BUG=skia: Change-Id: I379ba2ff0b44d865847877322e86d0c138e727c8 Reviewed-on: https://skia-review.googlesource.com/7356 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add F16 support to SkPNGImageEncoderGravatar Matt Sarett2017-01-19
| | | | | | | | | | | | BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ifd221365a7b9f9a4a4fc5382621e0da7189e1148 Reviewed-on: https://skia-review.googlesource.com/6526 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Respect SkColorSpace in SkPNGImageEncoderGravatar Matt Sarett2017-01-10
| | | | | | | | | | | | | | | | | | | | | | | This only changes behavior when the input SkBitmap/SkPixmap is tagged with a non-null SkColorSpace. Android tags their bitmaps as sRGB when linear blending is enabled. So this only changes behavior in Android when linear blending is turned on. *If linear blending is turned on, this will do a color correct encode (which is the desired behavior). *If linear blending is turned off, this will do a legacy encode. TODO: Add support for F16. TODO: Add color space support to WEBP. TODO: Tag encoded images with ICC profiles (when it makes sense). BUG=skia: Change-Id: Idd8a2836371d24a453d953e6fe2e76a87751be96 Reviewed-on: https://skia-review.googlesource.com/6498 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Use nullptr instead of png_NULL in SkPNGImageEncoderGravatar Matt Sarett2017-01-03
| | | | | | | | | | | Also includes a few additional cleanups. BUG=skia: Change-Id: I50899bfef964a3391cc9ddf42c3c5a939e01ceae Reviewed-on: https://skia-review.googlesource.com/6497 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Remove SkKTXImageEncoderGravatar Leon Scroggins III2016-12-14
| | | | | | | | | | | | | | It escaped the chopping block when we deleted the decoder, but it is currently untested and unused as far as we know. In addition to removing effectively unsupported code, this simplifies build file changes (i.e. don't build it on Android framework, but build it elsewhere) as we narrow our build systems down to one. Change-Id: I3b960fdcc369fb947be282933ddba48e407ab3ad Reviewed-on: https://skia-review.googlesource.com/6031 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Revert "Do not build the ktx encoder for android framework"Gravatar Mike Klein2016-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit eeb7137a0b421522de4c21c90fc3208e33e3a5a5. Reason for revert: well, duh, I guess we'd better update the GYP and Google3 builds... Original change's description: > Do not build the ktx encoder for android framework > > Move SkKTXImageEncoder.cpp into an optional block, and disable that > block for the android framework. Use a new define to determine whether > to define the entry point, rather than using > SK_BUILD_FOR_ANDROID_FRAMEWORK. > > Change-Id: I41103459135af744cf5715f27783c63dc37a7ad1 > Reviewed-on: https://skia-review.googlesource.com/5982 > Commit-Queue: Leon Scroggins <scroggo@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Mike Klein <mtklein@chromium.org> > TBR=mtklein@chromium.org,mtklein@google.com,scroggo@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I8da75db31884b5148f7f85a6a0c3e6913b71cfa8 Reviewed-on: https://skia-review.googlesource.com/6021 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Do not build the ktx encoder for android frameworkGravatar Leon Scroggins III2016-12-13
| | | | | | | | | | | | | Move SkKTXImageEncoder.cpp into an optional block, and disable that block for the android framework. Use a new define to determine whether to define the entry point, rather than using SK_BUILD_FOR_ANDROID_FRAMEWORK. Change-Id: I41103459135af744cf5715f27783c63dc37a7ad1 Reviewed-on: https://skia-review.googlesource.com/5982 Commit-Queue: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* No SkEncodeImageAsKTX for ANDROID_FRAMEWORKGravatar Hal Canary2016-12-01
| | | | | | | | | | BUG=skia: Change-Id: Ia2925eb6aecd576d078256013fe122a468c30a5a Reviewed-on: https://skia-review.googlesource.com/5421 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkEncodeImage: no more link-time registrationGravatar Hal Canary2016-11-30
| | | | | | | | | | | | | | | Also, no more SkImageEncoder class. SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS now only guards some old API shims. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5006 Change-Id: I3797f584f3e8e12ade10d31e8733163453725f40 Reviewed-on: https://skia-review.googlesource.com/5006 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Reed <reed@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>
* Fix bug: can't convert nullptr -> boolGravatar Hal Canary2016-11-22
| | | | | | | Change-Id: Ib37c46d00b6a3e768e6d8399f2a6afb332d36bff Reviewed-on: https://skia-review.googlesource.com/5141 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* remove SkPixelRef::refEncodedData()Gravatar Hal Canary2016-11-22
| | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5001 Change-Id: I15dba4f44c762ab69a23eb8a77adff5f63763e30 Reviewed-on: https://skia-review.googlesource.com/5001 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Reed <reed@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>
* 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>
* Revert "Speculative fix for flaky webp encode/decode on Nexus 5"Gravatar Matt Sarett2016-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 18a11a6f374fe430c8736c53ff4f8bc3c72cd54b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Speculative fix for flaky webp encode/decode on Nexus 5 > > I'm not really expecting this to work anymore... > > The docs don't say anything about the rgb pointer needing > to stay valid, and it looks like we are done with it > after the call to import. > > Still, worth a try I think. > > BUG=skia:5876 > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4024 > > Change-Id: I6e65ef96a2b661b01eb92bedab0acd73ed4f6218 > Reviewed-on: https://skia-review.googlesource.com/4024 > Reviewed-by: Mike Klein <mtklein@chromium.org> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=mtklein@chromium.org,msarett@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Id764782ea58acc99e4719c0bff22619abaf9c6e5 Reviewed-on: https://skia-review.googlesource.com/4150 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>