diff options
author | Matt Sarett <msarett@google.com> | 2017-02-22 13:02:31 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-22 18:51:33 +0000 |
commit | e522f4c455d0d5dbe813f38d16c0d4cd46fa5dee (patch) | |
tree | e0be77c59c8b06ac3b284104ab946613f2b6bdd7 /src/codec/SkCodec.cpp | |
parent | 416bbd97cee9e221577c729a8072fdb2057cbdf8 (diff) |
Enable legacy premuls in SkColorSpaceXform
***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>
Diffstat (limited to 'src/codec/SkCodec.cpp')
-rw-r--r-- | src/codec/SkCodec.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp index c31d533fd8..e9eeb4529a 100644 --- a/src/codec/SkCodec.cpp +++ b/src/codec/SkCodec.cpp @@ -474,17 +474,7 @@ void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row } } -bool SkCodec::initializeColorXform(const SkImageInfo& info) { - // TODO (msarett): - // Handle equality checking and legacy behavior for flagged SkColorSpaces. - // Until this is implemented, remove any flags on output color spaces. This - // will prevent strange behaviors. Ex: sRGB != sRGB + flag, but we don't want - // this to trigger a color xform. - SkImageInfo dstInfo = info; - if (dstInfo.colorSpace()) { - dstInfo = info.makeColorSpace(as_CSB(dstInfo.colorSpace())->makeWithoutFlags()); - } - +bool SkCodec::initializeColorXform(const SkImageInfo& dstInfo) { fColorXform = nullptr; bool needsPremul = needs_premul(dstInfo, fEncodedInfo); if (needs_color_xform(dstInfo, fSrcInfo, needsPremul)) { |