Index: src/codec/SkWebpCodec.cpp |
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp |
index a795fdd6d551637467cdf95fae5b4cffb07691d8..77af8e5e8f6fbf642e6de9678b5753de6d5f64df 100644 |
--- a/src/codec/SkWebpCodec.cpp |
+++ b/src/codec/SkWebpCodec.cpp |
@@ -85,9 +85,10 @@ SkCodec* SkWebpCodec::NewFromStream(SkStream* stream) { |
// This version is slightly different from SkCodecPriv's version of conversion_possible. It |
// supports both byte orders for 8888. |
static bool webp_conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) { |
- if (dst.profileType() != src.profileType()) { |
- return false; |
- } |
+ // FIXME: skbug.com/4895 |
+ // Currently, we ignore the SkColorProfileType on the SkImageInfo. We |
+ // will treat the encoded data as linear regardless of what the client |
scroggo
2016/04/07 12:35:54
linear? I thought this CL's whole purpose was to t
msarett
2016/04/07 13:03:52
Well, we want to mark them as sRGB. I think treat
|
+ // requests. |
if (!valid_alpha(dst.alphaType(), src.alphaType())) { |
return false; |
@@ -252,4 +253,6 @@ SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, |
} |
SkWebpCodec::SkWebpCodec(const SkImageInfo& info, SkStream* stream) |
- : INHERITED(info, stream) {} |
+ // The spec says an unmarked image is sRGB, so we return that space here. |
+ // TODO: Add support for parsing ICC profiles from webps. |
+ : INHERITED(info, stream, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)) {} |