aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkCodecImageGenerator.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>
* Remove old lazy image decoding heuristic logicGravatar Brian Osman2018-07-11
| | | | | | | | | | | This led to removing a lot of transfer function behavior code. There is more that could be done, and we need to add in decoding to dst color space, but this CL is almost entirely mechanical. Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6 Reviewed-on: https://skia-review.googlesource.com/140349 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE.Gravatar Ben Wagner2018-05-17
| | | | | | | | | All implementers have been updated, so remove the flag and old code. Change-Id: Ie9747f37dd0ea3f1db682891bcae2496a470bc3a Reviewed-on: https://skia-review.googlesource.com/128883 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkImage::onRefEncoded to return sk_sp.Gravatar Ben Wagner2018-05-16
| | | | | | | | | | | | This changes SkImage::onRefEncoded and downstack calls to return sk_sp. All of the values returned are already sk_sp, so this just updates the API. This change is currently behind the new flag SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE so that Chromium can be updated. Change-Id: Ic53a88ae23fa8b3b41b84c4abdc4b74e9879da38 Reviewed-on: https://skia-review.googlesource.com/128311 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Make SkImageGeneratorCG apply encoded originGravatar Leon Scroggins III2017-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | SkImageGeneratorCG: - Detect the origin and apply it to the output - Deprecate NewFromEncodedCG and add MakeFromEncodedCG SkCodecImageGenerator: - Move code elsewhere for sharing - Apply origin for incomplete decodes SkPixmap.cpp/SkPixmapPriv.h: - Now has the shared code for generators to apply origin DMSrcSink.cpp: - Call MakeFromEncodedCG SkCGUtils.h: - Add a version of SkCopyPixelsFromCGImage that takes an SkPixmap Bug: skia:7138 Bug: skia:3834 Change-Id: Ic6dbc76360c6a84913b67373582f328d3946d637 Reviewed-on: https://skia-review.googlesource.com/63740 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Move SkCodec::Origin into its own fileGravatar Leon Scroggins III2017-10-18
| | | | | | | | | | | | | | It is now used by SkPixmap and will soon be in SkJpegEncoder. No need for those to depend on SkCodec. Bug: 768878 TBR=reed@google.com (reed@ already approved the API change in https://skia-review.googlesource.com/60721) Change-Id: If1a6e1d5b60a7a3d8c97818e15a48d28ba804668 Reviewed-on: https://skia-review.googlesource.com/61680 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Revert "Add an Option for orientation on JPEG encodes"Gravatar Ben Wagner2017-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5411a60e0d7370a5d47b5049de845a06fe52e98b. Reason for revert: ASAN and Coverage failing: https://chromium-swarm.appspot.com/task?id=394978f3b7d44610 Flutter_Android failing. Original change's description: > Add an Option for orientation on JPEG encodes > > Move Origin to its own header so that SkPixmap and SkJpegEncoder need > not depend on SkCodec. > > Add libexif, which is already used by Android, and use it to write the > orientation. Write a makefile based on the Android.bp in Android, minus > warnings. (libexif has an LGPL license.) > > Add a test that verifies all the orientations work. > > Optionally enable writing the orientation (and therefore including > libexif). Chromium does not currently need it, and Android does not > expose an API that would allow using it. Disable on Windows, where we > still have build errors to fix. > > Bug: skia:7138 > Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1 > Reviewed-on: https://skia-review.googlesource.com/60721 > Commit-Queue: Leon Scroggins <scroggo@google.com> > Reviewed-by: Mike Klein <mtklein@chromium.org> > Reviewed-by: Mike Reed <reed@google.com> TBR=mtklein@chromium.org,mtklein@google.com,scroggo@google.com,reed@google.com Change-Id: I05b7ae8d1c5bbd1de1642d9ef024943500256273 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7138 Reviewed-on: https://skia-review.googlesource.com/61620 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* Add an Option for orientation on JPEG encodesGravatar Leon Scroggins III2017-10-18
| | | | | | | | | | | | | | | | | | | | | | | Move Origin to its own header so that SkPixmap and SkJpegEncoder need not depend on SkCodec. Add libexif, which is already used by Android, and use it to write the orientation. Write a makefile based on the Android.bp in Android, minus warnings. (libexif has an LGPL license.) Add a test that verifies all the orientations work. Optionally enable writing the orientation (and therefore including libexif). Chromium does not currently need it, and Android does not expose an API that would allow using it. Disable on Windows, where we still have build errors to fix. Bug: skia:7138 Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1 Reviewed-on: https://skia-review.googlesource.com/60721 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Revert[4] "apply codec origin in generator"Gravatar Mike Reed2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dd340146f1fe7414702d6fea251da989d425691e. Reason for revert: ios gn file fixed Original change's description: > Revert "Revert "Revert "apply codec origin in generator""" > > This reverts commit 82269abfec798621c8dbbc6bd48996c0b2686f41. > > Reason for revert: ios build needs include path for SkCodec.h > > Original change's description: > > Revert "Revert "apply codec origin in generator"" > > > > This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. > > > > Reason for revert: pdfium fix landed > > > > Original change's description: > > > Revert "apply codec origin in generator" > > > > > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > > > > > Reason for revert: Appears to break PDFium. > > > > > > Original change's description: > > > > apply codec origin in generator > > > > > > > > Bug: skia: > > > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > > > Reviewed-on: https://skia-review.googlesource.com/58600 > > > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > > > Commit-Queue: Mike Reed <reed@google.com> > > > > > > TBR=scroggo@google.com,reed@google.com > > > > > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia: > > > Reviewed-on: https://skia-review.googlesource.com/60041 > > > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > > > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > > > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > > > Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/60320 > > Reviewed-by: Mike Reed <reed@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60560 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I5c1e53aff3ad174b0d4a806c35b7cdcd194479d7 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60563 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "Revert "apply codec origin in generator"""Gravatar Mike Reed2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 82269abfec798621c8dbbc6bd48996c0b2686f41. Reason for revert: ios build needs include path for SkCodec.h Original change's description: > Revert "Revert "apply codec origin in generator"" > > This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. > > Reason for revert: pdfium fix landed > > Original change's description: > > Revert "apply codec origin in generator" > > > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > > > Reason for revert: Appears to break PDFium. > > > > Original change's description: > > > apply codec origin in generator > > > > > > Bug: skia: > > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > > Reviewed-on: https://skia-review.googlesource.com/58600 > > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > > Commit-Queue: Mike Reed <reed@google.com> > > > > TBR=scroggo@google.com,reed@google.com > > > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/60041 > > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60320 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60560 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "apply codec origin in generator""Gravatar Mike Reed2017-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. Reason for revert: pdfium fix landed Original change's description: > Revert "apply codec origin in generator" > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > Reason for revert: Appears to break PDFium. > > Original change's description: > > apply codec origin in generator > > > > Bug: skia: > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > Reviewed-on: https://skia-review.googlesource.com/58600 > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > TBR=scroggo@google.com,reed@google.com > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60041 > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > Commit-Queue: Ben Wagner <benjaminwagner@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60320 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "apply codec origin in generator"Gravatar Ben Wagner2017-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fa15877f487333bec876e7315cf584c0d598d098. Reason for revert: Appears to break PDFium. Original change's description: > apply codec origin in generator > > Bug: skia: > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > Reviewed-on: https://skia-review.googlesource.com/58600 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=scroggo@google.com,reed@google.com Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60041 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* apply codec origin in generatorGravatar Mike Reed2017-10-16
| | | | | | | | Bug: skia: Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a Reviewed-on: https://skia-review.googlesource.com/58600 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use unique_ptr for codec factoriesGravatar Mike Reed2017-07-25
| | | | | | | | | | Will need guards for android (at least) Bug: skia: Change-Id: I2bb8e656997984489ef1f2e41cd3d301c4e7b947 Reviewed-on: https://skia-review.googlesource.com/26040 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Index8 is dead, remove guarded codeGravatar Mike Reed2017-07-17
| | | | | | | | | | Needs google3 to be updated before this can land. Bug: skia:6828 Change-Id: I2c16be13c6937ffa48768cc24f9f980171c824d6 Reviewed-on: https://skia-review.googlesource.com/23940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Guard to remove kIndex_8_SkColorTypeGravatar Mike Reed2017-07-13
| | | | | | | | | Bug: skia:6828 Change-Id: Ia942a36abb18213184f8d436555a658270d97d47 Reviewed-on: https://skia-review.googlesource.com/22721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Reland "Remove support for decoding to kIndex_8"Gravatar Leon Scroggins2017-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original change's description: > > Remove support for decoding to kIndex_8 > > > > Fix up callsites, and remove tests that no longer make sense. > > > > Bug: skia:6828 > > Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295 > > Reviewed-on: https://skia-review.googlesource.com/21664 > > Reviewed-by: Derek Sollenberger <djsollen@google.com> > > Commit-Queue: Leon Scroggins <scroggo@google.com> > > TBR=djsollen@google.com,scroggo@google.com > > Change-Id: I1bc669441f250690884e75a9a61427fdf75c6907 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:6828 > Reviewed-on: https://skia-review.googlesource.com/22120 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Leon Scroggins <scroggo@google.com> TBR=djsollen@google.com,scroggo@google.com Bug: skia:6828 Change-Id: I36ff5a11c529d29e8adc95f43b8edc6fd1dbf5b8 Reviewed-on: https://skia-review.googlesource.com/22320 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Revert "Remove support for decoding to kIndex_8"Gravatar Leon Scroggins2017-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 742a3e298fda669006147e4a305bab8452369b1f. Reason for revert: Breaking Android roll: frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:453:18: error: no member named 'fColorPtr' in 'SkAndroidCodec::AndroidOptions' codecOptions.fColorPtr = colorPtr; ~~~~~~~~~~~~ ^ frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:454:18: error: no member named 'fColorCount' in 'SkAndroidCodec::AndroidOptions' codecOptions.fColorCount = colorCount; ~~~~~~~~~~~~ ^ Original change's description: > Remove support for decoding to kIndex_8 > > Fix up callsites, and remove tests that no longer make sense. > > Bug: skia:6828 > Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295 > Reviewed-on: https://skia-review.googlesource.com/21664 > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Commit-Queue: Leon Scroggins <scroggo@google.com> TBR=djsollen@google.com,scroggo@google.com Change-Id: I1bc669441f250690884e75a9a61427fdf75c6907 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6828 Reviewed-on: https://skia-review.googlesource.com/22120 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Remove support for decoding to kIndex_8Gravatar Leon Scroggins III2017-07-10
| | | | | | | | | | Fix up callsites, and remove tests that no longer make sense. Bug: skia:6828 Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295 Reviewed-on: https://skia-review.googlesource.com/21664 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add SkCodec::Result indicating error in the dataGravatar Leon Scroggins III2017-07-06
| | | | | | | | | | | | | | | | | | Previously, SkGifCodec treated an error in the LZW data as incomplete, since we can still draw the partially decoded image. But a client doing incremental decodes needs to distinguish this from truly incomplete data. In the case of an error, the client should not attempt to provide more data and decode again. Add kErrorInInput, and return it when SkGifCodec sees a fatal error. Treat it the same as kIncompleteInput when it comes to filling and DM. Bug: skia:6825 Change-Id: Ic6ce3a62c0b065ed34dcd8006309e43272a3db9f Reviewed-on: https://skia-review.googlesource.com/21530 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Chris Blume <cblume@chromium.org>
* Add new SkImageGenerator::getPixels() API, deprecate the oldGravatar Matt Sarett2017-05-12
| | | | | | | | | | | | This is fairly aggressive in that it will break any client that is currently using SkImageGenerator with kIndex8. I'm guessing that we don't have any clients doing that. Bug: skia:6620 Change-Id: Ifd16f5232bb3a9f759c225315c57492d917ed9ca Reviewed-on: https://skia-review.googlesource.com/16601 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Finish removing GrContext param from onRefEncodedDataGravatar Brian Osman2017-04-27
| | | | | | | | | | | TBR=reed@roogle.com Bug: skia:5485 Change-Id: Ia4ed45ffc39f2ba9a80d4a1001208079142ae985 Reviewed-on: https://skia-review.googlesource.com/14323 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove compressed texture support from cacheratorGravatar Brian Osman2017-04-25
| | | | | | | | | | | All variants of (on)?[rR]efEncoded(Data)? no longer need a GrContext parameter. Bug: skia:5485 skia:4971 Change-Id: If4f5e785718d5522eb3df8588318ccb8a02a5749 Reviewed-on: https://skia-review.googlesource.com/14269 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Use SkTransferFunctionBehavior in SkImageGeneratorGravatar Matt Sarett2017-04-03
| | | | | | | | | | | | This fixes SkColorSpaceXformCanvas gms that expect non-linear premuls from the codec. BUG=skia: Change-Id: I5dc236d0cd760c23605a26e9c33ddb18955f9231 Reviewed-on: https://skia-review.googlesource.com/10164 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@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>
* removed unused code around scaled generatorsGravatar Mike Reed2017-02-15
| | | | | | | | | | BUG=skia: Change-Id: I9e042cd9343e0f29032f84ee17b4b316214ec693 Reviewed-on: https://skia-review.googlesource.com/8403 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Do not support index8 for generateScaledPixelsGravatar Leon Scroggins III2016-12-22
| | | | | | | | | | | | Since the in/out parameter is a const SkPixmap without the proper color table, there is no way to tell the client about it without modifying the const SkPixmap. Rather than cheating, just return false. Change-Id: I63fdf57febc59e1ee9af13aa6eb9b253d19bcb17 Reviewed-on: https://skia-review.googlesource.com/6414 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Implement scaling in SkCodecImageGeneratorGravatar Leon Scroggins III2016-12-21
| | | | | | | | | | | Plumb calls down to SkCodec. Add a gm Change-Id: I16da24eb739295ab72f487df02f19968151443f3 Reviewed-on: https://skia-review.googlesource.com/6287 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* remove SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX flagGravatar Mike Reed2016-12-08
| | | | | | | | | BUG=skia: Change-Id: I51b7778db8b596b2633b6be9488af984cee2af70 Reviewed-on: https://skia-review.googlesource.com/5713 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Support decoding images to multiple formats, depending on usageGravatar Brian Osman2016-11-21
| | | | | | | | | | | | | | | | | | | | | | | | Our codec generator will now preserve any asked-for color space, and convert the encoded data to that representation. Cacherator now allows decoding an image to both legacy (nullptr color space), and color-correct formats. In color-correct mode, we choose the best decoded format, based on the original properties, and our backend's capabilities. Preference is given to the native format, when it's already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer linear F16, and fall back to sRGB when that's not an option. Re-land (and fix) of: https://skia-review.googlesource.com/c/4438/ https://skia-review.googlesource.com/c/4796/ BUG=skia:5907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4838 Change-Id: I20ff972ffe1c7e6535ddc501e2a8ab8c246e4061 Reviewed-on: https://skia-review.googlesource.com/4838 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Support decoding images to multiple formats, depending on usage"Gravatar Brian Osman2016-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c73a1ecbed64652b3d7aa8dc6face9a2205ce830. Reason for revert: ANGLE and CommandBuffer failures Original change's description: > Support decoding images to multiple formats, depending on usage > > Our codec generator will now preserve any asked-for color space, and > convert the encoded data to that representation. Cacherator now > allows decoding an image to both legacy (nullptr color space), and > color-correct formats. In color-correct mode, we choose the best > decoded format, based on the original properties, and our backend's > capabilities. Preference is given to the native format, when it's > already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer > linear F16, and fall back to sRGB when that's not an option. > > BUG=skia:5907 > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438 > > Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0 > Reviewed-on: https://skia-review.googlesource.com/4438 > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> > TBR=mtklein@google.com,bsalomon@google.com,msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I1818f937464573d601f64e5a1f1eb43f5a778f4e Reviewed-on: https://skia-review.googlesource.com/4832 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Support decoding images to multiple formats, depending on usageGravatar Brian Osman2016-11-15
| | | | | | | | | | | | | | | | | | | | Our codec generator will now preserve any asked-for color space, and convert the encoded data to that representation. Cacherator now allows decoding an image to both legacy (nullptr color space), and color-correct formats. In color-correct mode, we choose the best decoded format, based on the original properties, and our backend's capabilities. Preference is given to the native format, when it's already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer linear F16, and fall back to sRGB when that's not an option. BUG=skia:5907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438 Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0 Reviewed-on: https://skia-review.googlesource.com/4438 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* 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
* Support color xforms for kIndex8 pngsGravatar msarett2016-08-22
| | | | | | | | | | | | | | This change started as: "Always use color xforms to premultiply". We need to be in a linear space to premultiply correctly. It became clear that we also need to support kIndex8 color xforms in order to make this change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246143002 Review-Url: https://codereview.chromium.org/2246143002
* Remove obsolete image codec colorspace hacks.Gravatar brianosman2016-04-21
| | | | | | | | | | | | | With Herb's latest change, the codecs themselves are emitting images tagged based on the new (separate) global flag. All of the changes we had here to fixup color profile type are no longer needed (and just create more confusion). This change effectively reverts the file to where it was two commits ago. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904943003 Review URL: https://codereview.chromium.org/1904943003
* Add ability to default incoming image data as sRGB by default.Gravatar herb2016-04-15
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893663002 Review URL: https://codereview.chromium.org/1893663002
* Workaround to set the sRGB flag on SkImageGeneratorGravatar msarett2016-03-23
| | | | | | | BUG=skia:4895 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1820413002 Review URL: https://codereview.chromium.org/1820413002
* Update Skia's YUV APIGravatar msarett2016-03-10
| | | | | | | | | | | | | | We should match the recently designed API in SkCodec. https://codereview.chromium.org/1549473003/ This requires changes in Chromium as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 Committed: https://skia.googlesource.com/skia/+/095d31c8a0eeb5d491febf064bc3c8a44e22b94f Review URL: https://codereview.chromium.org/1716523002
* Revert of Update Skia's YUV API (patchset #5 id:160001 of ↵Gravatar msarett2016-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1716523002/ ) Reason for revert: Blimp failures with manual roll in Chrome. Original issue's description: > Update Skia's YUV API > > We should match the recently designed API in SkCodec. > https://codereview.chromium.org/1549473003/ > > This requires changes in Chromium as well. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 > > Committed: https://skia.googlesource.com/skia/+/095d31c8a0eeb5d491febf064bc3c8a44e22b94f TBR=scroggo@google.com,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1775493002
* Update Skia's YUV APIGravatar msarett2016-03-07
| | | | | | | | | | | | We should match the recently designed API in SkCodec. https://codereview.chromium.org/1549473003/ This requires changes in Chromium as well. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1716523002 Review URL: https://codereview.chromium.org/1716523002
* Add getYUV8Planes() API to SkCodecGravatar msarett2016-01-22
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1549473003 Review URL: https://codereview.chromium.org/1549473003
* Create an SkCodecImageGeneratorGravatar msarett2016-01-14
BUG=skia: patch from issue 1396323007 at patchset 120001 (http://crrev.com/1396323007#ps120001) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1487683004 Committed: https://skia.googlesource.com/skia/+/e1102ce1d3d0895e840e756e155ec56b5a1a7540 Review URL: https://codereview.chromium.org/1487683004