Index: third_party/WebKit/Source/platform/graphics/ColorSpaceProfile.h |
diff --git a/third_party/WebKit/Source/platform/graphics/ColorSpaceProfile.h b/third_party/WebKit/Source/platform/graphics/ColorSpaceProfile.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..27d97bb453ad26d077d339caeb97f07e575f1bf6 |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/graphics/ColorSpaceProfile.h |
@@ -0,0 +1,72 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ColorSpaceProfile_h |
+#define ColorSpaceProfile_h |
+ |
+#include "wtf/PassRefPtr.h" |
+#include "wtf/RefCounted.h" |
+#include "wtf/ThreadSafeRefCounted.h" |
+ |
+#if USE(QCMSLIB) |
+#include "qcms.h" |
+#endif |
+ |
+namespace blink { |
+ |
+#if USE(QCMSLIB) |
+ |
+class ColorSpaceProfile : public ThreadSafeRefCounted<ColorSpaceProfile> { |
+public: |
+ static PassRefPtr<ColorSpaceProfile> create(qcms_profile* profile) |
+ { |
+ return adoptRef(new ColorSpaceProfile(profile)); |
+ } |
+ |
+ qcms_profile* profile() { return m_profile; } |
+ |
+ ~ColorSpaceProfile() |
+ { |
+ if (m_profile) |
+ qcms_profile_release(m_profile); |
+ } |
+ |
+ static bool equal(qcms_profile* profile1, qcms_profile* profile2) |
+ { |
+ if (profile1 == profile2) |
+ return true; |
+ if (profile1 && profile2) |
+ return qcms_profile_match(profile1, profile2); |
+ return false; |
+ } |
+ |
+private: |
+ explicit ColorSpaceProfile(qcms_profile* profile) |
+ : m_profile(profile) |
+ { |
+ } |
+ |
+ qcms_profile* m_profile; |
+}; |
+ |
+#else |
+ |
+class ColorSpaceProfile : public RefCounted<ColorSpaceProfile> { |
+public: |
+ static PassRefPtr<ColorSpaceProfile> create(void*) |
+ { |
+ return nullptr; |
+ } |
+ |
+private: |
+ ColorSpaceProfile() |
+ { |
+ } |
+}; |
+ |
+#endif |
+ |
+} // namespace blink |
+ |
+#endif // ColorSpaceProfile_h |