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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows tests Created 4 years, 9 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/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;
};
ccameron 2016/03/15 06:02:24 Note that the optional colorProfile argument is us
- static qcms_profile* qcmsOutputDeviceProfile()
+ static qcms_profile* qcmsOutputDeviceProfile(const ColorProfile* colorProfile = 0)
{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(OutputDeviceProfile, outputDeviceProfile, new OutputDeviceProfile);
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(OutputDeviceProfile, outputDeviceProfile, new OutputDeviceProfile(colorProfile));
return outputDeviceProfile.profile();
}

Powered by Google App Engine
This is Rietveld 408576698