| Index: third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| index c1cb64a471998ea3f1508f3306a180c6237de77a..3bebb361f49c1496e6fa794cf165950cf6d99f1d 100644
|
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| @@ -277,7 +277,7 @@ static PassRefPtr<StaticBitmapImage> cropImage(
|
| const ParsedOptions& parsedOptions,
|
| AlphaDisposition imageFormat = PremultiplyAlpha,
|
| ImageDecoder::ColorSpaceOption colorSpaceOp =
|
| - ImageDecoder::ColorSpaceApplied) {
|
| + ImageDecoder::ColorSpaceTransformed) {
|
| ASSERT(image);
|
| IntRect imgRect(IntPoint(), IntSize(image->width(), image->height()));
|
| const IntRect srcRect = intersection(imgRect, parsedOptions.cropRect);
|
| @@ -312,7 +312,9 @@ static PassRefPtr<StaticBitmapImage> cropImage(
|
| image->data(), true,
|
| parsedOptions.premultiplyAlpha ? ImageDecoder::AlphaPremultiplied
|
| : ImageDecoder::AlphaNotPremultiplied,
|
| - colorSpaceOp));
|
| + colorSpaceOp, colorSpaceOp == ImageDecoder::ColorSpaceTransformed
|
| + ? ImageDecoder::globalTargetColorSpace()
|
| + : nullptr));
|
| if (!decoder)
|
| return nullptr;
|
| skiaImage = ImageBitmap::getSkImageFromDecoder(std::move(decoder));
|
| @@ -393,7 +395,7 @@ ImageBitmap::ImageBitmap(HTMLImageElement* image,
|
| ImageDecoder::ColorSpaceIgnored);
|
| } else {
|
| m_image = cropImage(input.get(), parsedOptions, PremultiplyAlpha,
|
| - ImageDecoder::ColorSpaceApplied);
|
| + ImageDecoder::ColorSpaceTransformed);
|
| }
|
| if (!m_image)
|
| return;
|
|
|