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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp

Issue 2454123002: Refactor image decoders to use 'colorSpace' instead of 'colorProfile' (Closed)
Patch Set: Fix legacy ImageFrame Created 4 years, 2 months 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/platform/graphics/gpu/WebGLImageConversion.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index 5541990e1a01f1bdf19d060e09b30c30dafc1c94..a892c2c0cee16179ecd00151d7c06646c05a6a61 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -2689,15 +2689,14 @@ WebGLImageConversion::ImageExtractor::ImageExtractor(
Image* image,
ImageHtmlDomSource imageHtmlDomSource,
bool premultiplyAlpha,
- bool ignoreGammaAndColorProfile) {
+ bool ignoreColorSpace) {
m_image = image;
m_imageHtmlDomSource = imageHtmlDomSource;
- extractImage(premultiplyAlpha, ignoreGammaAndColorProfile);
+ extractImage(premultiplyAlpha, ignoreColorSpace);
}
-void WebGLImageConversion::ImageExtractor::extractImage(
- bool premultiplyAlpha,
- bool ignoreGammaAndColorProfile) {
+void WebGLImageConversion::ImageExtractor::extractImage(bool premultiplyAlpha,
+ bool ignoreColorSpace) {
ASSERT(!m_imagePixelLocker);
if (!m_image)
@@ -2710,15 +2709,13 @@ void WebGLImageConversion::ImageExtractor::extractImage(
m_alphaOp = AlphaDoNothing;
bool hasAlpha = skiaImage ? !skiaImage->isOpaque() : true;
- if ((!skiaImage || ignoreGammaAndColorProfile ||
- (hasAlpha && !premultiplyAlpha)) &&
+ if ((!skiaImage || ignoreColorSpace || (hasAlpha && !premultiplyAlpha)) &&
m_image->data()) {
// Attempt to get raw unpremultiplied image data.
std::unique_ptr<ImageDecoder> decoder(ImageDecoder::create(
m_image->data(), true, ImageDecoder::AlphaNotPremultiplied,
- ignoreGammaAndColorProfile
- ? ImageDecoder::GammaAndColorProfileIgnored
- : ImageDecoder::GammaAndColorProfileApplied));
+ ignoreColorSpace ? ImageDecoder::ColorSpaceIgnored
+ : ImageDecoder::ColorSpaceApplied));
if (!decoder || !decoder->frameCount())
return;
ImageFrame* frame = decoder->frameBufferAtIndex(0);

Powered by Google App Engine
This is Rietveld 408576698