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

Unified Diff: third_party/WebKit/Source/core/frame/ImageBitmap.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698