| Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
|
| diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
|
| index c397e7bcf1af164c711aaa7df78f4c5f4f835eef..cdb28a64501e1a552e3830c0779704d2a6fe7e4b 100644
|
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
|
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
|
| @@ -359,14 +359,22 @@ void ImageDecoder::setTargetColorProfile(const WebVector<char>& profile) {
|
| }
|
|
|
| void ImageDecoder::setColorSpaceAndComputeTransform(const char* iccData,
|
| - unsigned iccLength,
|
| - bool useSRGB) {
|
| + unsigned iccLength) {
|
| // Sub-classes should not call this if they were instructed to ignore embedded
|
| // color profiles.
|
| - DCHECK(!m_ignoreGammaAndColorProfile);
|
| + DCHECK(!m_ignoreColorSpace);
|
|
|
| - m_colorProfile.assign(iccData, iccLength);
|
| - m_hasColorProfile = true;
|
| + sk_sp<SkColorSpace> srcSpace = SkColorSpace::NewICC(iccData, iccLength);
|
| + setColorSpaceAndComputeTransform(std::move(srcSpace));
|
| +}
|
| +
|
| +void ImageDecoder::setColorSpaceAndComputeTransform(
|
| + sk_sp<SkColorSpace> srcSpace) {
|
| + if (!srcSpace) {
|
| + return;
|
| + }
|
| +
|
| + m_srcSpace = srcSpace;
|
|
|
| // With color correct rendering, we do not transform to the output color space
|
| // at decode time. Instead, we tag the raw image pixels and pass the tagged
|
| @@ -376,17 +384,6 @@ void ImageDecoder::setColorSpaceAndComputeTransform(const char* iccData,
|
|
|
| m_sourceToOutputDeviceColorTransform = nullptr;
|
|
|
| - // Create the input profile.
|
| - sk_sp<SkColorSpace> srcSpace = nullptr;
|
| - if (useSRGB) {
|
| - srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
|
| - } else {
|
| - srcSpace = SkColorSpace::NewICC(iccData, iccLength);
|
| - }
|
| -
|
| - if (!srcSpace)
|
| - return;
|
| -
|
| // Take a lock around initializing and accessing the global device color
|
| // profile.
|
| SpinLock::Guard guard(gTargetColorSpaceLock);
|
|
|