aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkCodecPriv.h
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>
* Make SkAndroidCodec (optionally) respect originGravatar Leon Scroggins III2018-01-26
| | | | | | | | | | | | | | | | | Bug: b/63909536 ImageDecoder will respect the origin, but BitmapFactory will maintain its current behavior of not respecting it. Add an option to respect it. In addition, add support for reading the EXIF data from a WEBP. This seems to be an uncommon use case, but is occasionally used when converting from a JPEG. Add 8 WEBPs, all converted (with cwebp) from their analogous JPEG files already checked in. Change-Id: I38afca58c86fa99ee9ab7d1dc83aaa4f23132c11 Reviewed-on: https://skia-review.googlesource.com/95300 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Stop defining SK_CODEC_PRINTF in debugGravatar Leon Scroggins III2018-01-19
| | | | | | | | | | | Too much spew during DM. TBR=reed@google.com Change-Id: Ifad53b1abb35d1768e83e7867f9e808df3fcaef1 Reviewed-on: https://skia-review.googlesource.com/97160 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add an SkDrawable for animated images (e.g. GIF)Gravatar Leon Scroggins III2018-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: b/63909536 SkAnimatedImage is a simple drawable for animating a GIF. Thread-safety is left up to the client. At most two bitmaps are stored in the drawable; one for the current frame and one for a frame that may need to be restored. The backup frame prevents some cases where we would otherwise have to re-decode from the beginning of the image. The API lets the client set the time value, and decodes to match that time. TODO: - Callback for when the animation is complete - Ability to use SkAndroidCodec - Modify the loop count (or leave that up to client?) - Better and/or client-specific caching Other changes: - Add a sample which animates a GIF - Reenable SK_CODEC_PRINTF for debug builds and Android Change-Id: I945ffbccdb6008f2a05ed4d9b2af869a261fb300 Reviewed-on: https://skia-review.googlesource.com/93420 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Call initializeColorXform inside SkCodecGravatar Leon Scroggins III2017-08-18
| | | | | | | | | | | | | | | | | | | | | | | | Make initializeColorXform private, and only call in the base class. Add virtual method to skip initializeColorXform, for classes that do not need one. Change SkCodec::FrameInfo's SkAlphaType to an SkEncodedInfo::Alpha. This allows proper checking internally whether SkCodec needs to do a color correct premultiply. Depends on https://chromium-review.googlesource.com/c/620947, for this API change. (Separated from review.skia.org/25746) Bug: skia:5609 Bug: skia:6839 Change-Id: Icb0d46659c546060c34d32eaf792c86708726c7a Reviewed-on: https://skia-review.googlesource.com/35880 Reviewed-by: Chris Blume <cblume@chromium.org> Reviewed-by: Derek Sollenberger <djsollen@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Move calls to conversion_possible to SkCodecGravatar Leon Scroggins III2017-08-17
| | | | | | | | | | | | | | | | | | | | | | | | Move common code into the base class, so subclasses need not call conversion_possible. Use SkEncodedInfo rather than SkImageInfo, and use the proper frame. API Changes: - SkAndroidCodec: - Add getEncodedInfo(), for SkBitmapRegionCodec - SkEncodedInfo: - Add opaque() helper - SkBitmapRegionDecoder: - Remove unused conversionSupported (Split off from skia-review.googlesource.com/c/25746) Bug: skia:5601 Change-Id: If4a40d4b98a3dd0afde2b6058f92315a393a5baf Reviewed-on: https://skia-review.googlesource.com/34361 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@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>
* Simplify SkCodecs' call to SkColorSpaceXform::applyGravatar Leon Scroggins III2017-06-05
| | | | | | | | | | | | | | | | | | | | | | | | | | Most SkCodec subclasses did the following to apply their SkColorSpaceXform: dstFormat = select_xform_format(dstInfo.colorType()); srcFormat = select_xform_format(<something that doesn't change>); xformAlphaType = select_xform_alpha(dstInfo.alphaType(), this->getInfo().alphaType()); this->colorXform()->apply(dstFormat, dst, srcFormat, src, width, xformAlphaType); Consolidate the computation of these parameters into SkCodec and add a new method to SkCodec that calls apply() with those parameters. Add a SkColorSpaceXform::ColorFormat to SkCodec. This allows the new method SkCodec::applyColorXform to supply the ColorFormat. TBR=reed@google.com (No change to public API.) Change-Id: I8ea7ba4c0024be827a9f9359796c778744330f6e Reviewed-on: https://skia-review.googlesource.com/18523 Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* 565 codec color xform support: fix colortable / incomplete image behaviorGravatar Matt Sarett2017-04-04
| | | | | | | | | | | | | | | | | | This fixes a bug that was exposed when I added color space support for 565 decodes. Before this CL, we would sometimes fill incomplete images with R and B swapped. This fixes that issue. Part of the fix is the decision to do 565 xforms when building the color table (then just swizzle to 565), rather than do them per pixel after swizzling. Bug: skia: Change-Id: I09e1ec75aba09a4e288015ea746465d0c3f7d59f Reviewed-on: https://skia-review.googlesource.com/11137 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Add codec and color xform support for 565Gravatar Matt Sarett2017-03-28
| | | | | | | | Bug: skia: Change-Id: I23184acc4e17d38861d27ab81172048a24c400d2 Reviewed-on: https://skia-review.googlesource.com/10288 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Delete SkColorSpace::ColorSpaceFlagsGravatar Matt Sarett2017-03-24
| | | | | | | | | BUG=skia: Change-Id: Ia0688876915cd773614ca0c4ccd467cf6e7c603e Reviewed-on: https://skia-review.googlesource.com/10105 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@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>
* Enable legacy premuls in SkColorSpaceXformGravatar Matt Sarett2017-02-22
| | | | | | | | | | | | | | | | | | | | | ***Will allow for simplified Android framework code, they typically want a color correct transform followed by a gamma encoded premul. ***Chrome does the same, so this will make it easier to replace their codecs. ***Will decrease code size. Both types of premuls are moved off the fast path here - one is essentially unused in production and the other is not "encouraged". ***Will actually make the common case faster: sRGB->sRGB means no color xform, just premul in SkSwizzler. BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ia4ec1d273b6f137151f951d37c0ebf975f6b9a3e Reviewed-on: https://skia-review.googlesource.com/8848 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Improve color space support in SkImage::readPixels()Gravatar Matt Sarett2016-12-22
| | | | | | | | | | | | Correct handling of kGray, k565, k4444 etc. is still a TODO. SkImage_Generator and SkImage_Gpu are still TODOs. BUG=skia:6021 Change-Id: Ib53d97d3a866b2b4934fd85c10100855743a8fab Reviewed-on: https://skia-review.googlesource.com/6396 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Finish color space support for SkCodecGravatar Matt Sarett2016-11-07
| | | | | | | | | | | | | Implements color space xforms and F16 for SkRawCodec and SkWbmpCodec. BUG=skia:4895 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4459 Change-Id: I8c72918e46387350b49a9811ce654d26b1ab352a Reviewed-on: https://skia-review.googlesource.com/4459 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Add F16, SkColorSpaceXform support to SkGifCodecGravatar Matt Sarett2016-11-04
| | | | | | | | | | | BUG=skia:4895 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4396 Change-Id: I7c521760891852daf4f3933ecf02dc08acec64c0 Reviewed-on: https://skia-review.googlesource.com/4396 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Fix color xforms for Index8 bmpsGravatar Matt Sarett2016-11-04
| | | | | | | | | | | | | Thanks to Gold for catching this. BUG=skia:4895 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4426 Change-Id: Icc816d933e9e2fd312858a5430fa21a47722563e Reviewed-on: https://skia-review.googlesource.com/4426 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Add SkColorSpaceXform to the public APIGravatar msarett2016-10-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2390263002 Review-Url: https://codereview.chromium.org/2390263002
* Add BGRA as input format to SkColorSpaceXformGravatar msarett2016-09-22
| | | | | | | | | | This is immediately useful for webp and I think it's a fair guess that BGRA src formats are not uncommon. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2353363008 Review-Url: https://codereview.chromium.org/2353363008
* Support Float32 output from SkColorSpaceXformGravatar msarett2016-09-16
| | | | | | | | | | | | | | | * Adds Float32 support to SkColorSpaceXform * Changes API to allows clients to ask for F32, updates clients to new API * Adds Sk4f_load4 and Sk4f_store4 to SkNx * Make use of new xform in SkGr.cpp BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47 Review-Url: https://codereview.chromium.org/2339233003
* Revert of Support Float32 output from SkColorSpaceXform (patchset #7 ↵Gravatar msarett2016-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:140001 of https://codereview.chromium.org/2339233003/ ) Reason for revert: Hitting an assert Original issue's description: > Support Float32 output from SkColorSpaceXform > > * Adds Float32 support to SkColorSpaceXform > * Changes API to allows clients to ask for F32, updates clients to > new API > * Adds Sk4f_load4 and Sk4f_store4 to SkNx > * Make use of new xform in SkGr.cpp > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003 > CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47 TBR=brianosman@google.com,mtklein@google.com,scroggo@google.com,mtklein@chromium.org,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/2347473007
* Support Float32 output from SkColorSpaceXformGravatar msarett2016-09-16
| | | | | | | | | | | | | | * Adds Float32 support to SkColorSpaceXform * Changes API to allows clients to ask for F32, updates clients to new API * Adds Sk4f_load4 and Sk4f_store4 to SkNx * Make use of new xform in SkGr.cpp BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/2339233003
* Implement Fill() for incomplete decodes to RGBA_F16Gravatar msarett2016-09-13
| | | | | | | | | Before this patch, we would hit an SkASSERT(false). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335203002 Review-Url: https://codereview.chromium.org/2335203002
* Checking for valid colorType, alphaType, colorSpace in SkCodecGravatar msarett2016-09-08
| | | | | | | | | | | | | | | | | * Refactor to share code between SkPngCodec and SkWebpCodec * Didn't end up sharing with SkJpegCodec but did refactor that code a bit * Disallow conversions to F16 with non-linear color spaces * Fail to decode if we fail to create a SkColorSpaceXform (should be an assert soon). We used to fallback on a legacy decode if we failed to create the transform. * A bunch of name changes BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2319293003 Committed: https://skia.googlesource.com/skia/+/7a9900d6d34e437bb24beb5524a1f6488ae138c9 Review-Url: https://codereview.chromium.org/2319293003
* Revert of Checking for valid colorType, alphaType, colorSpace in SkCodec ↵Gravatar msarett2016-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #2 id:100001 of https://codereview.chromium.org/2319293003/ ) Reason for revert: Broken perf bots Original issue's description: > Checking for valid colorType, alphaType, colorSpace in SkCodec > > * Refactor to share code between SkPngCodec and SkWebpCodec > * Didn't end up sharing with SkJpegCodec but did refactor > that code a bit > * Disallow conversions to F16 with non-linear color spaces > * Fail to decode if we fail to create a SkColorSpaceXform > (should be an assert soon). We used to fallback on a > legacy decode if we failed to create the transform. > * A bunch of name changes > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2319293003 > > Committed: https://skia.googlesource.com/skia/+/7a9900d6d34e437bb24beb5524a1f6488ae138c9 TBR=scroggo@google.com,brianosman@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/2328663002
* Checking for valid colorType, alphaType, colorSpace in SkCodecGravatar msarett2016-09-08
| | | | | | | | | | | | | | | | * Refactor to share code between SkPngCodec and SkWebpCodec * Didn't end up sharing with SkJpegCodec but did refactor that code a bit * Disallow conversions to F16 with non-linear color spaces * Fail to decode if we fail to create a SkColorSpaceXform (should be an assert soon). We used to fallback on a legacy decode if we failed to create the transform. * A bunch of name changes BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2319293003 Review-Url: https://codereview.chromium.org/2319293003
* Add color xform support to SkWebpCodecGravatar msarett2016-09-08
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2294993002 Committed: https://skia.googlesource.com/skia/+/828ed1777da74692d0c8a5834017929f5aedcc6b Review-Url: https://codereview.chromium.org/2294993002
* Revert of Add color xform support to SkWebpCodec (patchset #2 id:80001 of ↵Gravatar msarett2016-09-07
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2294993002/ ) Reason for revert: Windows bots hate it when I upload new images. Original issue's description: > Add color xform support to SkWebpCodec > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2294993002 > > Committed: https://skia.googlesource.com/skia/+/828ed1777da74692d0c8a5834017929f5aedcc6b TBR=scroggo@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/2318253004
* Add color xform support to SkWebpCodecGravatar msarett2016-09-07
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2294993002 Review-Url: https://codereview.chromium.org/2294993002
* 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
* Perform color correction on png decodesGravatar msarett2016-08-03
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2184543003 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/2184543003
* Finish supporting decoding opaque to non-opaqueGravatar scroggo2016-05-20
| | | | | | | | | | | | | | | | | When decoding to 565 or Gray, allow the client to incorrectly ask for premul. When checking whether it's possible to decode to 565, return whether the source is opaque. In DM, allow decoding to 565 or Gray, even if the client also asked for premul. This fixes a bug introduced in crrev.com/1999593003 when we stopped ever requesting Opaque, resulting in us not testing 565 or Gray. BUG=skia:4616 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1996993003 Review-Url: https://codereview.chromium.org/1996993003
* Support the non-native (RGBA/BGRA) swizzleGravatar msarett2016-04-22
| | | | | | | BUG=skia:4456 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1907593004 Review URL: https://codereview.chromium.org/1907593004
* 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
* Parse icc profiles and exif orientation from jpeg markersGravatar msarett2016-03-21
| | | | | | | | | | New resources should be fine to add since they are already checked into chromium. BUG=skia:3834 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813273002 Review URL: https://codereview.chromium.org/1813273002
* Move SkUtils.h to src/core.Gravatar bungeman2016-02-23
| | | | Review URL: https://codereview.chromium.org/1722703003
* Fix colorType/alphaType checks in SkCodecGravatar msarett2016-02-15
| | | | | | | | | | | | | | | | Make getPixels() and startScanlineDecode() behave consistently. Require that kGray8 decodes are opaque. Assert that creating the swizzler succeeds. BUG=skia:4203 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1695473002 Committed: https://skia.googlesource.com/skia/+/c7578b6cdd03b61f076ffc7956efd952d6c301c0 Review URL: https://codereview.chromium.org/1695473002
* Revert of Fix colorType/alphaType checks in SkCodec (patchset #5 id:80001 of ↵Gravatar msarett2016-02-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1695473002/ ) Reason for revert: Really bad images in Gold. Original issue's description: > Fix colorType/alphaType checks in SkCodec > > Make getPixels() and startScanlineDecode() behave > consistently. > > Require that kGray8 decodes are opaque. > > Assert that creating the swizzler succeeds. > > BUG=skia:4203 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1695473002 > > Committed: https://skia.googlesource.com/skia/+/c7578b6cdd03b61f076ffc7956efd952d6c301c0 TBR=scroggo@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4203 Review URL: https://codereview.chromium.org/1694023002
* Fix colorType/alphaType checks in SkCodecGravatar msarett2016-02-12
| | | | | | | | | | | | | | Make getPixels() and startScanlineDecode() behave consistently. Require that kGray8 decodes are opaque. Assert that creating the swizzler succeeds. BUG=skia:4203 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1695473002 Review URL: https://codereview.chromium.org/1695473002
* Set sRGB flag for PNGs with an sRGB chunkGravatar msarett2016-02-04
| | | | | | | BUG=skia:3471 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1667823004 Review URL: https://codereview.chromium.org/1667823004
* Support decoding opaque to *premulGravatar scroggo2016-02-03
| | | | | | | | | | | | | | | | | | | | | | If a client requests unpremul or premul from an opaque SkCodec, support it. The opaque image can be treated as any of them, though it will be less efficient to draw than if the client had used opaque. Change the filling code (i.e. for incomplete images) to base its color on the source alpha type. Prior to adding the support to decode opaque to any, it was fine to use either source or dest (which would have yielded the same result). If the client requests non-opaque, we do not want this to switch the fill value from black to transparent. This also allows simplifying the signatures for getFillValue and onGetFillValue. In CodexTest, expect the same result when decoding opaque to *premul, and compare to the opaque version. BUG=skia:4616 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1641273003 Review URL: https://codereview.chromium.org/1641273003
* Delete reallyHasAlpha() from SkCodecGravatar msarett2016-01-11
| | | | | | | | TBR=reed BUG=skia:3582 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1557403002 Review URL: https://codereview.chromium.org/1557403002
* Create an SkAndroidCodec API separate from SkCodecGravatar msarett2015-10-21
| | | | | | | | | | | | We will implement this API using SkCodecs. SkAndroidCodecs will be used to implement the BitmapRegionDecoder Java API (and possibly BitmapFactory). BUG=skia: Review URL: https://codereview.chromium.org/1406223002
* Fill incomplete images in SkCodec parent classGravatar msarett2015-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | Rather than implementing some sort of "fill" in every SkCodec subclass for incomplete images, let's make the parent class handle this situation. This includes an API change to SkCodec.h SkCodec::getScanlines() now returns the number of lines it read successfully, rather than an SkCodec::Result enum. getScanlines() most often fails on an incomplete input, in which case it is useful to know how many lines were successfully decoded - this provides more information than kIncomplete vs kSuccess. We do lose information when the API is used improperly, as we are no longer able to return kInvalidParameter or kScanlineNotStarted. Known Issues: Does not work for incomplete fFrameIsSubset gifs. Does not work for incomplete icos. BUG=skia: Review URL: https://codereview.chromium.org/1332053002
* Scanline decoding for gifsGravatar msarett2015-09-07
| | | | | | | | BUG=skia: Committed: https://skia.googlesource.com/skia/+/e9c10b9121887e8c300bd41357461418e061984d Review URL: https://codereview.chromium.org/1305123002
* Revert of Scanline decoding for gifs (patchset #15 id:380001 of ↵Gravatar jcgregorio2015-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1305123002/ ) Reason for revert: Breaks the build with SkScanlineDecoder.h not found: http://build.chromium.org/p/client.skia/builders/Linux%20Builder/builds/3722/steps/compile/logs/stdio ../../third_party/skia/src/utils/SkBitmapRegionCanvas.h:10:10: fatal error: 'SkScanlineDecoder.h' file not found #include "SkScanlineDecoder.h" Original issue's description: > Scanline decoding for gifs > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e9c10b9121887e8c300bd41357461418e061984d TBR=scroggo@google.com,djsollen@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1320273004
* Scanline decoding for gifsGravatar msarett2015-09-04
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1305123002