<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[198719] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/198719">198719</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-03-26 16:50:38 -0700 (Sat, 26 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move extended color detection into Open Source
https://bugs.webkit.org/show_bug.cgi?id=155909
&lt;rdar://problem/25369754&gt;

Reviewed by Anders Carlsson.

The code for detecting extended color displays
was hidden while the iPad Pro 9.7&quot; was in development.
Now it is public, move the detection to Open Source.

While doing this, add a new method to PlatformScreen
so that we have a more obvious way to detect such
displays.

Source/WebCore:

* platform/PlatformScreen.h: Add screenSupportsExtendedColor.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::commonInit): Set the backing
store format to the RGBA10XR if we're on an extended
display.
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
(WebCore::setBackingStoreFormat): Deleted. Now set directly
in the constructor.

* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenDepthPerComponent): Cleanup.
(WebCore::screenSupportsExtendedColor): Implement the
iOS version of this using MobileGestalt.

* platform/mac/PlatformScreenMac.mm:
(WebCore::displayFromWidget): Whitespace cleanup.
(WebCore::screenForWidget):
(WebCore::screenForWindow):
(WebCore::screenSupportsExtendedColor): Default implementation
returns false for all screens at the moment.

* platform/spi/cocoa/QuartzCoreSPI.h: New constant.
* platform/spi/ios/MobileGestaltSPI.h: Ditto.

Source/WebKit2:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::bufferFormat): No need to use WebKitAdditions any
more.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformScreenh">trunk/Source/WebCore/platform/PlatformScreen.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosLegacyTileGridTilemm">trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformScreenIOSmm">trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformScreenMacmm">trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh">trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h</a></li>
<li><a href="#trunkSourceWebCoreplatformspiiosMobileGestaltSPIh">trunk/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerBackingStoremm">trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/ChangeLog        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-03-25  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Move extended color detection into Open Source
+        https://bugs.webkit.org/show_bug.cgi?id=155909
+        &lt;rdar://problem/25369754&gt;
+
+        Reviewed by Anders Carlsson.
+
+        The code for detecting extended color displays
+        was hidden while the iPad Pro 9.7&quot; was in development.
+        Now it is public, move the detection to Open Source.
+
+        While doing this, add a new method to PlatformScreen
+        so that we have a more obvious way to detect such
+        displays.
+
+        * platform/PlatformScreen.h: Add screenSupportsExtendedColor.
+
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (PlatformCALayerCocoa::commonInit): Set the backing
+        store format to the RGBA10XR if we're on an extended
+        display.
+        * platform/ios/LegacyTileGridTile.mm:
+        (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
+        (WebCore::setBackingStoreFormat): Deleted. Now set directly
+        in the constructor.
+
+        * platform/ios/PlatformScreenIOS.mm:
+        (WebCore::screenDepthPerComponent): Cleanup.
+        (WebCore::screenSupportsExtendedColor): Implement the
+        iOS version of this using MobileGestalt.
+
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::displayFromWidget): Whitespace cleanup.
+        (WebCore::screenForWidget):
+        (WebCore::screenForWindow):
+        (WebCore::screenSupportsExtendedColor): Default implementation
+        returns false for all screens at the moment.
+
+        * platform/spi/cocoa/QuartzCoreSPI.h: New constant.
+        * platform/spi/ios/MobileGestaltSPI.h: Ditto.
+
</ins><span class="cx"> 2016-03-26  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [OS X] Layout  sometimes flakily assumes overlay scrollbars when clicky-scroll-wheel-mouse is attached and system preference detects scrollbar mode
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformScreenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformScreen.h (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformScreen.h        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/PlatformScreen.h        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -63,6 +63,8 @@
</span><span class="cx">     FloatRect screenRect(Widget*);
</span><span class="cx">     FloatRect screenAvailableRect(Widget*);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT bool screenSupportsExtendedColor();
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     NSScreen *screenForWindow(NSWindow *);
</span><span class="cx">     NSScreen *screenForDisplayID(PlatformDisplayID);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &quot;LengthFunctions.h&quot;
</span><span class="cx"> #import &quot;PlatformCAAnimationCocoa.h&quot;
</span><span class="cx"> #import &quot;PlatformCAFilters.h&quot;
</span><ins>+#import &quot;PlatformScreen.h&quot;
</ins><span class="cx"> #import &quot;QuartzCoreSPI.h&quot;
</span><span class="cx"> #import &quot;ScrollbarThemeMac.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><span class="lines">@@ -59,16 +60,6 @@
</span><span class="cx"> #import &quot;ThemeMac.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/LayerBackingStoreAdditions.mm&gt;
-#else
-namespace WebCore {
-static void setBackingStoreFormat(CALayer *)
-{
-}
-} // namespace WebCore
-#endif
-
</del><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
</span><span class="lines">@@ -301,8 +292,12 @@
</span><span class="cx">     else
</span><span class="cx">         [m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="cx"> 
</span><del>-    if (m_layerType == LayerTypeWebLayer || m_layerType == LayerTypeTiledBackingTileLayer)
-        setBackingStoreFormat(m_layer.get());
</del><ins>+    if (m_layerType == LayerTypeWebLayer || m_layerType == LayerTypeTiledBackingTileLayer) {
+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90300
+        if (screenSupportsExtendedColor())
+            [m_layer setContentsFormat:kCAContentsFormatRGBA10XR];
+#endif
+    }
</ins><span class="cx"> 
</span><span class="cx">     // So that the scrolling thread's performance logging code can find all the tiles, mark this as being a tile.
</span><span class="cx">     if (m_layerType == LayerTypeTiledBackingTileLayer)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosLegacyTileGridTilemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/ios/LegacyTileGridTile.mm        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -33,24 +33,15 @@
</span><span class="cx"> #include &quot;LegacyTileGrid.h&quot;
</span><span class="cx"> #include &quot;LegacyTileLayer.h&quot;
</span><span class="cx"> #include &quot;LegacyTileLayerPool.h&quot;
</span><ins>+#include &quot;PlatformScreen.h&quot;
</ins><span class="cx"> #include &quot;QuartzCoreSPI.h&quot;
</span><span class="cx"> #include &quot;WAKWindow.h&quot;
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;functional&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/LayerBackingStoreAdditions.mm&gt;
-#else
</del><span class="cx"> namespace WebCore {
</span><del>-static void setBackingStoreFormat(CALayer *)
-{
-}
-} // namespace WebCore
-#endif
</del><span class="cx"> 
</span><del>-namespace WebCore {
-
</del><span class="cx"> #if LOG_TILING
</span><span class="cx"> static int totalTileCount;
</span><span class="cx"> #endif
</span><span class="lines">@@ -71,7 +62,10 @@
</span><span class="cx">         m_tileLayer = adoptNS([[LegacyTileLayer alloc] init]);
</span><span class="cx">     }
</span><span class="cx">     LegacyTileLayer* layer = m_tileLayer.get();
</span><del>-    setBackingStoreFormat(layer);
</del><ins>+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90300
+    if (screenSupportsExtendedColor())
+        layer.contentsFormat = kCAContentsFormatRGBA10XR;
+#endif
</ins><span class="cx">     [layer setTileGrid:tileGrid];
</span><span class="cx">     [layer setOpaque:m_tileGrid-&gt;tileCache().tilesOpaque()];
</span><span class="cx">     [layer setEdgeAntialiasingMask:0];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformScreenIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> int screenDepthPerComponent(Widget*)
</span><span class="cx"> {
</span><span class="cx">     // Assume the screen depth is evenly divided into four color components. See &lt;rdar://problem/9378829&gt;.
</span><del>-    return screenDepth(0) / 4;
</del><ins>+    return screenDepth(nullptr) / 4;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool screenIsMonochrome(Widget*)
</span><span class="lines">@@ -69,6 +69,15 @@
</span><span class="cx">     return UIAccessibilityIsInvertColorsEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool screenSupportsExtendedColor()
+{
+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90300
+    return MGGetBoolAnswer(kMGQHasExtendedColorDisplay);
+#else
+    return false;
+#endif
+}
+
</ins><span class="cx"> // These functions scale between screen and page coordinates because JavaScript/DOM operations
</span><span class="cx"> // assume that the screen and the page share the same coordinate system.
</span><span class="cx"> FloatRect screenRect(Widget* widget)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformScreenMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!widget)
</span><span class="cx">         return 0;
</span><del>-    
</del><ins>+
</ins><span class="cx">     FrameView* view = widget-&gt;root();
</span><span class="cx">     if (!view)
</span><span class="cx">         return 0;
</span><span class="lines">@@ -62,11 +62,11 @@
</span><span class="cx">     // Widget is in an NSWindow, use its screen.
</span><span class="cx">     if (window)
</span><span class="cx">         return screenForWindow(window);
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Didn't get an NSWindow; probably WebKit2. Try using the Widget's display ID.
</span><span class="cx">     if (NSScreen *screen = screenForDisplayID(displayFromWidget(widget)))
</span><span class="cx">         return screen;
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Widget's window is offscreen, or no screens. Fall back to the first screen if available.
</span><span class="cx">     return screenForWindow(nil);
</span><span class="cx"> }
</span><span class="lines">@@ -118,11 +118,11 @@
</span><span class="cx">     NSScreen *screen = [window screen]; // nil if the window is off-screen
</span><span class="cx">     if (screen)
</span><span class="cx">         return screen;
</span><del>-    
</del><ins>+
</ins><span class="cx">     NSArray *screens = [NSScreen screens];
</span><span class="cx">     if ([screens count] &gt; 0)
</span><span class="cx">         return [screens objectAtIndex:0]; // screen containing the menubar
</span><del>-    
</del><ins>+
</ins><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -135,6 +135,11 @@
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool screenSupportsExtendedColor()
+{
+    return false; // FIXME: Update this to detect extended color screens.
+}
+
</ins><span class="cx"> FloatRect toUserSpace(const NSRect&amp; rect, NSWindow *destination)
</span><span class="cx"> {
</span><span class="cx">     FloatRect userRect = rect;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -186,6 +186,10 @@
</span><span class="cx"> extern NSString * const kCAContextDisplayId;
</span><span class="cx"> extern NSString * const kCAContextIgnoresHitTest;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90300
+extern NSString * const kCAContentsFormatRGBA10XR;
+#endif
+
</ins><span class="cx"> #if (PLATFORM(APPLETV) &amp;&amp; __TV_OS_VERSION_MIN_REQUIRED &lt; 100000) \
</span><span class="cx">     || (PLATFORM(WATCHOS) &amp;&amp; __WATCH_OS_VERSION_MIN_REQUIRED &lt; 30000) \
</span><span class="cx">     || (PLATFORM(IOS) &amp;&amp; TARGET_OS_IOS &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &lt; 100000) \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspiiosMobileGestaltSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> static const CFStringRef kMGQiPadCapability = CFSTR(&quot;ipad&quot;);
</span><span class="cx"> static const CFStringRef kMGQDeviceName = CFSTR(&quot;DeviceName&quot;);
</span><span class="cx"> static const CFStringRef kMGQDeviceClassNumber = CFSTR(&quot;DeviceClassNumber&quot;);
</span><ins>+static const CFStringRef kMGQHasExtendedColorDisplay = CFSTR(&quot;HasExtendedColorDisplay&quot;);
</ins><span class="cx"> 
</span><span class="cx"> typedef enum {
</span><span class="cx">     MGDeviceClassInvalid = -1,
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-03-25  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Move extended color detection into Open Source
+        https://bugs.webkit.org/show_bug.cgi?id=155909
+        &lt;rdar://problem/25369754&gt;
+
+        Reviewed by Anders Carlsson.
+
+        The code for detecting extended color displays
+        was hidden while the iPad Pro 9.7&quot; was in development.
+        Now it is public, move the detection to Open Source.
+
+        While doing this, add a new method to PlatformScreen
+        so that we have a more obvious way to detect such
+        displays.
+
+        * Shared/mac/RemoteLayerBackingStore.mm:
+        (WebKit::bufferFormat): No need to use WebKitAdditions any
+        more.
+
</ins><span class="cx"> 2016-03-26  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Treat SHA-1-signed certificates as insecure by default.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerBackingStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (198718 => 198719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm        2016-03-26 20:07:25 UTC (rev 198718)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm        2016-03-26 23:50:38 UTC (rev 198719)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import &lt;WebCore/IOSurface.h&gt;
</span><span class="cx"> #import &lt;WebCore/MachSendRight.h&gt;
</span><span class="cx"> #import &lt;WebCore/PlatformCALayerClient.h&gt;
</span><ins>+#import &lt;WebCore/PlatformScreen.h&gt;
</ins><span class="cx"> #import &lt;WebCore/QuartzCoreSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebLayer.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -45,27 +46,20 @@
</span><span class="cx"> #import &lt;mach/mach_port.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(APPLE_INTERNAL_SDK)
-#import &lt;WebKitAdditions/RemoteLayerBackingStoreAdditions.mm&gt;
-#else
</del><ins>+using namespace WebCore;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> #if USE(IOSURFACE)
</span><del>-static WebCore::IOSurface::Format bufferFormat(bool)
</del><ins>+static WebCore::IOSurface::Format bufferFormat(bool isOpaque)
</ins><span class="cx"> {
</span><ins>+    if (screenSupportsExtendedColor())
+        return isOpaque ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGB10A8;
+
</ins><span class="cx">     return WebCore::IOSurface::Format::RGBA;
</span><span class="cx"> }
</span><span class="cx"> #endif // USE(IOSURFACE)
</span><span class="cx"> 
</span><del>-} // namespace WebKit
-
-#endif
-
-using namespace WebCore;
-
-namespace WebKit {
-
</del><span class="cx"> RemoteLayerBackingStore::RemoteLayerBackingStore(PlatformCALayerRemote* layer)
</span><span class="cx">     : m_layer(layer)
</span><span class="cx">     , m_isOpaque(false)
</span></span></pre>
</div>
</div>

</body>
</html>