Index: src/codec/SkCodecImageGenerator.cpp |
diff --git a/src/codec/SkCodecImageGenerator.cpp b/src/codec/SkCodecImageGenerator.cpp |
index db13aaea2973f62445477f8fefdf42bef948d761..39abf8b324bc32876eae38aa150fdab66416b75b 100644 |
--- a/src/codec/SkCodecImageGenerator.cpp |
+++ b/src/codec/SkCodecImageGenerator.cpp |
@@ -6,6 +6,7 @@ |
*/ |
#include "SkCodecImageGenerator.h" |
+#include "SkPM4fPriv.h" |
SkImageGenerator* SkCodecImageGenerator::NewFromEncodedCodec(SkData* data) { |
SkCodec* codec = SkCodec::NewFromData(data); |
@@ -25,9 +26,12 @@ static SkImageInfo fix_info(const SkCodec& codec) { |
SkAlphaType alphaType = (kUnpremul_SkAlphaType == info.alphaType()) ? kPremul_SkAlphaType : |
info.alphaType(); |
- // Crudely guess that the presence of a color space means sRGB. |
- SkColorProfileType profileType = (codec.getColorSpace()) ? kSRGB_SkColorProfileType : |
- kLinear_SkColorProfileType; |
+ SkColorProfileType profileType = kSRGB_SkColorProfileType; |
reed1
2016/04/15 19:22:38
should we start out linear?
herb_g
2016/04/15 19:38:55
Done.
|
+ // Crudely guess that the presence of a color space means sRGB, or obey the global sRGB |
+ // selector. |
+ if (gTreatSkColorAsSRGB || codec.getColorSpace()) { |
+ profileType = kSRGB_SkColorProfileType; |
+ } |
return SkImageInfo::Make(info.width(), info.height(), info.colorType(), alphaType, profileType); |
} |