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>
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index c31d533..e9eeb45 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -474,17 +474,7 @@
}
}
-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)) {