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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

Issue 1523243002: [qcms] Apply qcms color matching api to Blink images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update TestExpectations: account for crbug.com/569600 Created 5 years 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/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 1704bc29a369e42928497664f45dfbc8681c827c..dba37f772bd3d69b20d69e0ab2d77a602d3ea3c7 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -650,11 +650,19 @@ public:
qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
if (!inputProfile)
return;
+
// We currently only support color profiles for RGB profiled images.
ASSERT(rgbData == qcms_profile_get_color_space(inputProfile));
- qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
+
+ if (qcms_profile_match(inputProfile, deviceProfile)) {
+ qcms_profile_release(inputProfile);
+ return;
+ }
+
// FIXME: Don't force perceptual intent if the image profile contains an intent.
+ qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
+
qcms_profile_release(inputProfile);
}
#endif

Powered by Google App Engine
This is Rietveld 408576698