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

Unified Diff: third_party/WebKit/Source/platform/graphics/ColorSpaceProfile.h

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 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/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

Powered by Google App Engine
This is Rietveld 408576698