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

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

Issue 1488133002: Add usage metrics for display and image color profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed histograms to use suffixes 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/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 eea37216069119c5290f1214cdcbc4869be27544..aae986c09f11421e96370477debebfbe36e0c74d 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -49,6 +49,22 @@ typedef Vector<char> ColorProfile;
namespace blink {
+#if USE(QCMSLIB)
+enum ColorProfileStatus {
+ ColorProfileNone = 0,
Noel Gordon 2015/12/23 15:28:48 I think we an reduce the number of entries here.
+ ColorProfileNotFound = 1, // A profile was expected but could not be retrieved
+ ColorProfileIsCorrupted = 2,
+ ColorProfileIsNotRGB = 3,
+ ColorProfileIsNotAnInputProfile = 4,
+ ColorProfileIsV4 = 5,
+ ColorProfileFailedDecode = 6,
+ ColorProfileIsBogus = 7,
+ ColorProfileSuccess = 8,
+ ColorProfileSuccess_PNGsRGB = 9, // Using built-in sRGB tag (no actual embedded profile)
+ ValueCount = 10
+};
+#endif
+
// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame.
class PLATFORM_EXPORT ImagePlanes {
public:
@@ -212,25 +228,16 @@ public:
return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4);
}
+ static bool isICCv4(const char* profileData, unsigned profileLength)
Noel Gordon 2015/12/23 15:28:48 This can go, I think. Note we have an API to get
+ {
+ ASSERT_UNUSED(profileLength, profileLength >= iccColorProfileHeaderLength);
+
+ return profileData[8] == 4;
+ }
+
class OutputDeviceProfile {
public:
- OutputDeviceProfile()
- : m_outputDeviceProfile(0)
- {
- 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)
- qcms_profile_precache_output_transform(m_outputDeviceProfile);
- }
+ OutputDeviceProfile();
qcms_profile* profile() const { return m_outputDeviceProfile; }

Powered by Google App Engine
This is Rietveld 408576698