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

Unified Diff: third_party/WebKit/Source/platform/graphics/ColorSpaceFilterCache.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/ColorSpaceFilterCache.h
diff --git a/third_party/WebKit/Source/platform/graphics/ColorSpaceFilterCache.h b/third_party/WebKit/Source/platform/graphics/ColorSpaceFilterCache.h
new file mode 100644
index 0000000000000000000000000000000000000000..c68880b3895c03c0cabdfacf3bb11773fb5600b5
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/ColorSpaceFilterCache.h
@@ -0,0 +1,60 @@
+// 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 ColorSpaceFilterCache_h
+#define ColorSpaceFilterCache_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/PassRefPtr.h"
+
+class SkColorFilter;
+
+namespace blink {
+
+class ColorSpaceProfile;
+
+PLATFORM_EXPORT PassRefPtr<SkColorFilter> findColorTransform(ColorSpaceProfile* source, ColorSpaceProfile* target);
+PLATFORM_EXPORT void cacheColorTransform(ColorSpaceProfile* source, ColorSpaceProfile* target, SkColorFilter*);
+PLATFORM_EXPORT void pruneColorTransform(ColorSpaceProfile* target);
+
+struct ScreenDevice {
+
+ enum SystemColorProfiles {
+ sRGB = 0, // sRGB: default (source).
+ sRGBCanvas = 1, // sRGB: HTML <canvas> (target).
+ sRGBPlugin = 2, // sRGB: PPAPI web font rendering access (target).
+ sRGBPrint = 3, // sRGB: Printing (target).
+ sRGBTest = 4, // sRGB: Unit testing (target).
+ };
+
+ enum VideoColorProfiles {
+ BT709 = 5, // Rec BT.709 HDTV-UTI (source).
+ BT601SMPTEC = 6, // Rec BT.601 SMPTE-C (source).
+ BT601EBUPAL = 7, // Rec BT.601 EBU PAL/SECAM (source).
+ };
+
+ static bool isDefaultDeviceId(uintptr_t deviceId)
+ {
+ return deviceId <= static_cast<uintptr_t>(BT601EBUPAL);
+ }
+
+ static bool isSRGBDeviceId(uintptr_t deviceId)
+ {
+ return deviceId <= static_cast<uintptr_t>(sRGBPrint);
+ }
+
+ static bool isSRGBCanvasDeviceId(uintptr_t deviceId)
+ {
+ return deviceId == static_cast<uintptr_t>(sRGBCanvas);
+ }
+
+ static bool shouldIgnoreDeviceId(uintptr_t deviceId)
+ {
+ return deviceId == static_cast<uintptr_t>(sRGBPlugin);
+ }
+};
+
+} // namespace blink
+
+#endif // ColorSpaceFilterCache_h

Powered by Google App Engine
This is Rietveld 408576698