Chromium Code Reviews| Index: src/codec/SkPngCodec.cpp |
| diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp |
| index 232373c04407c63c2b391c148a7053db9e9d62e9..656df7da0b837f868a4b32732f3d972ae606584d 100644 |
| --- a/src/codec/SkPngCodec.cpp |
| +++ b/src/codec/SkPngCodec.cpp |
| @@ -328,10 +328,13 @@ static bool read_header(SkStream* stream, SkPngChunkReader* chunkReader, |
| *numberPassesPtr = numberPasses; |
| } |
| - // FIXME: Also need to check for sRGB ( https://bug.skia.org/3471 ). |
| + SkColorProfileType profileType = kLinear_SkColorProfileType; |
| + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sRGB)) { |
| + profileType = kSRGB_SkColorProfileType; |
| + } |
| if (imageInfo) { |
| - *imageInfo = SkImageInfo::Make(origWidth, origHeight, colorType, alphaType); |
| + *imageInfo = SkImageInfo::Make(origWidth, origHeight, colorType, alphaType, profileType); |
|
scroggo
2016/02/04 16:37:52
conversion_possible checks to make sure the profil
msarett
2016/02/04 16:44:35
You're right. This would break us all over the pl
scroggo
2016/02/04 16:53:01
I think that's a fine choice for now. I think we h
msarett
2016/02/04 17:09:53
sgtm
|
| } |
| autoClean.detach(); |
| if (png_ptrp) { |