Title: [206845] trunk/Source/WebCore
Revision
206845
Author
[email protected]
Date
2016-10-05 22:15:32 -0700 (Wed, 05 Oct 2016)

Log Message

Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>

Reviewed by Sam Weinig.

Add a new ColorSpace for Display P3.

This will be tested once the Color class can create
objects that reference other color spaces.

* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206844 => 206845)


--- trunk/Source/WebCore/ChangeLog	2016-10-06 04:24:57 UTC (rev 206844)
+++ trunk/Source/WebCore/ChangeLog	2016-10-06 05:15:32 UTC (rev 206845)
@@ -1,3 +1,22 @@
+2016-10-05  Dean Jackson  <[email protected]>
+
+        Add Display P3 ColorSpace
+        https://bugs.webkit.org/show_bug.cgi?id=162880
+        <rdar://problem/28598564>
+
+        Reviewed by Sam Weinig.
+
+        Add a new ColorSpace for Display P3.
+
+        This will be tested once the Color class can create
+        objects that reference other color spaces.
+
+        * platform/graphics/ColorSpace.h:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::displayP3ColorSpaceRef):
+        * platform/graphics/cg/GraphicsContextCG.h:
+        (WebCore::cachedCGColorSpace):
+
 2016-10-05  Wenson Hsieh  <[email protected]>
 
         Introduce InputEvent bindings in preparation for the input events spec

Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.h (206844 => 206845)


--- trunk/Source/WebCore/platform/graphics/ColorSpace.h	2016-10-06 04:24:57 UTC (rev 206844)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.h	2016-10-06 05:15:32 UTC (rev 206845)
@@ -31,7 +31,8 @@
 enum ColorSpace {
     ColorSpaceDeviceRGB,
     ColorSpaceSRGB,
-    ColorSpaceLinearRGB
+    ColorSpaceLinearRGB,
+    ColorSpaceDisplayP3
 };
     
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (206844 => 206845)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2016-10-06 04:24:57 UTC (rev 206844)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp	2016-10-06 05:15:32 UTC (rev 206845)
@@ -94,6 +94,16 @@
     return sRGBSpace;
 }
 
+CGColorSpaceRef displayP3ColorSpaceRef()
+{
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
+    static CGColorSpaceRef displayP3Space = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);
+#else
+    static CGColorSpaceRef displayP3Space = sRGBColorSpaceRef();
+#endif
+    return displayP3Space;
+}
+
 #if PLATFORM(WIN)
 CGColorSpaceRef linearRGBColorSpaceRef()
 {

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h (206844 => 206845)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h	2016-10-06 04:24:57 UTC (rev 206844)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h	2016-10-06 05:15:32 UTC (rev 206845)
@@ -34,6 +34,7 @@
 
 CGColorSpaceRef deviceRGBColorSpaceRef();
 WEBCORE_EXPORT CGColorSpaceRef sRGBColorSpaceRef();
+WEBCORE_EXPORT CGColorSpaceRef displayP3ColorSpaceRef();
 CGColorSpaceRef linearRGBColorSpaceRef();
 
 inline CGAffineTransform getUserToBaseCTM(CGContextRef context)
@@ -50,6 +51,8 @@
         return sRGBColorSpaceRef();
     case ColorSpaceLinearRGB:
         return linearRGBColorSpaceRef();
+    case ColorSpaceDisplayP3:
+        return displayP3ColorSpaceRef();
     }
     ASSERT_NOT_REACHED();
     return deviceRGBColorSpaceRef();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to