Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp

Issue 2523943002: Explicitly specify target color space to ImageDecoder at creation (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
index 90aea4e63d3bd276be70ab6b0cb0d740e411d677..f053a33e37d4afb757810137089f54b41c110043 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
@@ -279,13 +279,17 @@ void ImageBitmapFactories::ImageBitmapLoader::decodeImageOnDecoderThread(
ImageDecoder::AlphaOption alphaOp = ImageDecoder::AlphaPremultiplied;
if (premultiplyAlphaOption == "none")
alphaOp = ImageDecoder::AlphaNotPremultiplied;
- ImageDecoder::ColorSpaceOption colorSpaceOp = ImageDecoder::ColorSpaceApplied;
+ ImageDecoder::ColorSpaceOption colorSpaceOp =
+ ImageDecoder::ColorSpaceTransformed;
if (colorSpaceConversionOption == "none")
colorSpaceOp = ImageDecoder::ColorSpaceIgnored;
std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create(
SegmentReader::createFromSkData(SkData::MakeWithoutCopy(
arrayBuffer->data(), arrayBuffer->byteLength())),
- true, alphaOp, colorSpaceOp));
+ true, alphaOp, colorSpaceOp,
+ colorSpaceOp == ImageDecoder::ColorSpaceTransformed
+ ? ImageDecoder::globalTargetColorSpace()
+ : nullptr));
sk_sp<SkImage> frame;
if (decoder) {
frame = ImageBitmap::getSkImageFromDecoder(std::move(decoder));

Powered by Google App Engine
This is Rietveld 408576698