Chromium Code Reviews| Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| index 518499f4cffb1b79fb486880c1e322264b9d87e2..24d6115c15797420c0b759c0ac5b41598540a383 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| @@ -93,6 +93,8 @@ public: |
| virtual ~ImageDecoder() { } |
| + static void setOutputDeviceColorProfile(const ColorProfile&); |
| + |
| // Returns a caller-owned decoder of the appropriate type. Returns 0 if |
| // we can't sniff a supported type from the provided data (possibly |
| // because there isn't enough data yet). |
| @@ -228,12 +230,11 @@ public: |
| USING_FAST_MALLOC(OutputDeviceProfile); |
| WTF_MAKE_NONCOPYABLE(OutputDeviceProfile); |
| public: |
| - OutputDeviceProfile() |
| + OutputDeviceProfile(const ColorProfile* colorProfile) |
| : m_outputDeviceProfile(0) |
| { |
| - ColorProfile profile = screenColorProfile(); |
| - if (!profile.isEmpty()) |
| - m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size()); |
| + if (colorProfile && !colorProfile->isEmpty()) |
| + m_outputDeviceProfile = qcms_profile_from_memory(colorProfile->data(), colorProfile->size()); |
| if (m_outputDeviceProfile && qcms_profile_is_bogus(m_outputDeviceProfile)) { |
| qcms_profile_release(m_outputDeviceProfile); |
| @@ -249,23 +250,12 @@ public: |
| qcms_profile* profile() const { return m_outputDeviceProfile; } |
| private: |
| - static ColorProfile screenColorProfile() |
| - { |
| - // FIXME: Add optional ICCv4 support and support for multiple monitors. |
| - WebVector<char> profile; |
| - Platform::current()->screenColorProfile(&profile); |
| - |
| - ColorProfile colorProfile; |
| - colorProfile.append(profile.data(), profile.size()); |
| - return colorProfile; |
| - } |
| - |
| qcms_profile* m_outputDeviceProfile; |
| }; |
| - static qcms_profile* qcmsOutputDeviceProfile() |
| + static qcms_profile* qcmsOutputDeviceProfile(const ColorProfile* colorProfile = 0) |
|
dcheng
2016/03/15 17:28:08
= nullptr
ccameron
2016/03/15 18:22:05
Done.
|
| { |
| - DEFINE_THREAD_SAFE_STATIC_LOCAL(OutputDeviceProfile, outputDeviceProfile, new OutputDeviceProfile); |
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(OutputDeviceProfile, outputDeviceProfile, new OutputDeviceProfile(colorProfile)); |
| return outputDeviceProfile.profile(); |
| } |