Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
index 9e2eae50bd3a8a31e5b62fff429fc46a0bd420c6..a8a658686d43238c6d317e5186ff0e08c344512b 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
@@ -244,6 +244,40 @@ size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex, bool frameRect |
} |
} |
+#if USE(QCMSLIB) |
+ImageDecoder::OutputDeviceProfile::OutputDeviceProfile() : m_outputDeviceProfile(0) |
+{ |
+ ColorProfileStatus status = ColorProfileSuccess; |
+ |
+ ColorProfile profile = screenColorProfile(); |
+ if (!profile.isEmpty()) { |
+ if (ImageDecoder::isICCv4(profile.data(), profile.size())) { |
+ status = ColorProfileIsV4; |
+ } else { |
+ m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size()); |
+ if (!m_outputDeviceProfile) { |
+ status = ColorProfileFailedDecode; |
+ } else { |
+ if (qcms_profile_is_bogus(m_outputDeviceProfile)) { |
+ status = ColorProfileIsBogus; |
+ qcms_profile_release(m_outputDeviceProfile); |
+ m_outputDeviceProfile = 0; |
+ } |
+ } |
+ } |
+ } else { |
+ status = ColorProfileNone; |
+ } |
+ |
+ Platform::current()->histogramEnumeration("ColorManagement.ScreenColorProfileStatus", status, ColorProfileStatus::ValueCount); |
+ |
+ if (!m_outputDeviceProfile) |
+ m_outputDeviceProfile = qcms_profile_sRGB(); |
+ if (m_outputDeviceProfile) |
+ qcms_profile_precache_output_transform(m_outputDeviceProfile); |
+} |
+#endif |
+ |
ImagePlanes::ImagePlanes() |
{ |
for (int i = 0; i < 3; ++i) { |