Index: Source/platform/image-decoders/ImageDecoder.h |
diff --git a/Source/platform/image-decoders/ImageDecoder.h b/Source/platform/image-decoders/ImageDecoder.h |
index 4f5d4f9a401d29af91609c6444e6c25373510a31..0a3a1ebfde4519eae8a2bec9dafd09d17ed1c9d2 100644 |
--- a/Source/platform/image-decoders/ImageDecoder.h |
+++ b/Source/platform/image-decoders/ImageDecoder.h |
@@ -43,6 +43,8 @@ |
#include "qcms.h" |
#endif |
+typedef Vector<char> ColorProfile; |
Mike West
2014/09/15 07:12:16
It looks this type is only used in the OutputDevic
Noel Gordon
2014/09/15 07:27:17
Yeah, it's needed in (JPEG|PNG|WEBP)ImageDecoder f
|
+ |
namespace blink { |
// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame. |
@@ -196,16 +198,15 @@ public: |
OutputDeviceProfile() |
: m_outputDeviceProfile(0) |
{ |
- // FIXME: Add optional ICCv4 support. |
- // FIXME: add support for multiple monitors. |
- ColorProfile profile; |
- screenColorProfile(profile); |
+ ColorProfile profile = screenColorProfile(); |
if (!profile.isEmpty()) |
m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size()); |
+ |
if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDeviceProfile)) { |
qcms_profile_release(m_outputDeviceProfile); |
m_outputDeviceProfile = 0; |
} |
+ |
if (!m_outputDeviceProfile) |
m_outputDeviceProfile = qcms_profile_sRGB(); |
if (m_outputDeviceProfile) |
@@ -215,6 +216,17 @@ public: |
qcms_profile* profile() const { return m_outputDeviceProfile; } |
private: |
+ static ColorProfile screenColorProfile() |
+ { |
+ // FIXME: Add optional ICCv4 support and support for multiple monitors. |
Mike West
2014/09/15 07:12:16
Nit: Is there a bug filed for this FIXME? It'd be
Noel Gordon
2014/09/15 07:27:17
https://crbug.com/353818 and I know the bug well.
|
+ WebVector<char> profile; |
+ Platform::current()->screenColorProfile(&profile); |
+ |
+ ColorProfile colorProfile; |
+ colorProfile.append(profile.data(), profile.size()); |
jochen (gone - plz use gerrit)
2014/09/15 12:46:02
Why not just use the WebVector<>? You now copy the
Noel Gordon
2014/09/15 12:55:53
The data was copied twice before this change (refe
|
+ return colorProfile; |
+ } |
+ |
qcms_profile* m_outputDeviceProfile; |
}; |