aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images/SkImageEncoder.cpp
Commit message (Collapse)AuthorAge
* Replace nearly all kRespect with kIgnoreGravatar Brian Osman2018-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | - Encoders and decoders always assume kIgnore. - They are less opinionated about F16 and color space, we just trust the color space that's passed in, and put that directly in the image (no sRGB encoding). - SkBitmap and SkPixmap read/write pixels functions were defaulting to kResepct, those are now always kIgnore. - Many other bits of plumbing are simplified, and I added a default of kIgnore to SkImage::makeColorSpace, so we can phase out that argument entirely. - Still need to add defaults to other public APIs that take SkTransferFunctionBehavior. - This makes gold think that we've dramatically changed the contents of all F16 images, but that's because it doesn't understand the (now linear) color space that's embedded. Once we triage them all once, they will work fine (and they'll look perfect in the browser). Bug: skia: Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747 Reviewed-on: https://skia-review.googlesource.com/140570 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* centralize encoding to SkDataGravatar Mike Reed2017-12-09
| | | | | | | | Bug: skia: Change-Id: If3a9a6de54cf76d03e4d159b54b07a4ea6d5cda9 Reviewed-on: https://skia-review.googlesource.com/83020 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Use kIgnore blend behavior when encoding JPEGGravatar Leon Scroggins III2017-09-06
| | | | | | | | | | | This looks to have been an oversight - encoding PNG and WEBP both use kIgnore when called through this interface. Bug: b/65262488 Change-Id: I23ba02f979210087808ee2da026a2ca0269e0fb4 Reviewed-on: https://skia-review.googlesource.com/43261 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* change SkStreams to work with sk_sp<SkData> instead of SkData*Gravatar reed2016-09-12
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002 Review-Url: https://codereview.chromium.org/2333713002
* default SkPixelSerializerGravatar halcanary2015-12-10
| | | | | | | | | | | | | | | Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. Add SkImageEncoder::CreatePixelSerializer() to return a PixelSerializer that calls into SkImageEncoder::EncodeData. SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce Review URL: https://codereview.chromium.org/1507123002
* Revert of default SkPixelSerializer (patchset #2 id:20001 of ↵Gravatar halcanary2015-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1507123002/ ) Reason for revert: I was overconfident. Original issue's description: > default SkPixelSerializer > > Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. > > Add SkImageEncoder::CreatePixelSerializer() to return a > PixelSerializer that calls into SkImageEncoder::EncodeData. > > SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. > > Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b > > Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce TBR=reed@google.com,scroggo@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1511183002
* default SkPixelSerializerGravatar halcanary2015-12-08
| | | | | | | | | | | | | Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. Add SkImageEncoder::CreatePixelSerializer() to return a PixelSerializer that calls into SkImageEncoder::EncodeData. SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b Review URL: https://codereview.chromium.org/1507123002
* Revert of default SkPixelSerializer (patchset #1 id:1 of ↵Gravatar reed2015-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1507123002/ ) Reason for revert: Breaking DEPS roll (linker error) Original issue's description: > default SkPixelSerializer > > Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. > > Add SkImageEncoder::CreatePixelSerializer() to return a > PixelSerializer that calls into SkImageEncoder::EncodeData. > > SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. > > Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b TBR=scroggo@google.com,halcanary@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1505203003
* default SkPixelSerializerGravatar halcanary2015-12-08
| | | | | | | | | | | Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function. Add SkImageEncoder::CreatePixelSerializer() to return a PixelSerializer that calls into SkImageEncoder::EncodeData. SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer. Review URL: https://codereview.chromium.org/1507123002
* Revert of change pixel-serializer to support reencoding existing data ↵Gravatar reed2015-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #5 id:80001 of https://codereview.chromium.org/1373683003/ ) Reason for revert: Need to somehow get access to encoders in chrome -- link error on the roll since SkImageEncoder is not built as part of chrome. Original issue's description: > change pixel-serializer to support reencoding existing data > > Trying to evolve this interface so it can > - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT > - allow for encoding images as well as bitmaps (e.g. for picture serialization) > - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/13f48dc85aa68a60da66aaf39c93d527d11d1278 TBR=scroggo@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1371983003
* change pixel-serializer to support reencoding existing dataGravatar reed2015-09-28
| | | | | | | | | | | Trying to evolve this interface so it can - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT - allow for encoding images as well as bitmaps (e.g. for picture serialization) - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) BUG=skia: Review URL: https://codereview.chromium.org/1373683003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* add const to encodePixels pixel parameterGravatar reed2014-12-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/788143007
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-05-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9207 2bbb7eff-a529-9590-31e7-b0007b416f81
* add encodeData() to SkImageEncoder, and add encoding to SkImageGravatar reed@google.com2013-05-20
| | | | | | | | | BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/15002004 git-svn-id: http://skia.googlecode.com/svn/trunk@9193 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* separate image encode and decodeGravatar reed@android.com2009-01-06
remove obsolete build-flag for encode git-svn-id: http://skia.googlecode.com/svn/trunk@56 2bbb7eff-a529-9590-31e7-b0007b416f81