<!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>[213541] trunk</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/213541">213541</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2017-03-07 14:23:33 -0800 (Tue, 07 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add GPUDevice implementation and WebGPULayer
https://bugs.webkit.org/show_bug.cgi?id=169219
&lt;rdar://problem/30879048&gt;

Reviewed by Sam Weinig.

Source/WebCore:

Add a basic implementation of a GPUDevice object,
which references a MTLDevice. Also add a WebGPULayer
that will ultimately be used to host WebGPU content.

WebKit API Test: WebCore/mac/GPUDevice.mm

* Configurations/WebCore.xcconfig: Link to Metal.

* PlatformMac.cmake: New files.
* WebCore.xcodeproj/project.pbxproj:

* platform/Logging.h: Add a WebGPU logging channel.

* platform/graphics/cocoa/GPUDeviceMetal.mm: Added.
(WebCore::GPUDevice::GPUDevice): Cocoa implementation.
(WebCore::GPUDevice::reshape):
* platform/graphics/cocoa/WebGPULayer.h: Added.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer initWithGPUDevice:]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):
(-[WebGPULayer display]):
* platform/graphics/gpu/GPUDevice.cpp: Added.
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::~GPUDevice):
(WebCore::GPUDevice::GPUDevice): Implementation for platforms
other than Mac and iOS hardware.
(WebCore::GPUDevice::reshape):
* platform/graphics/gpu/GPUDevice.h: Added.
(WebCore::GPUDevice::platformLayer):
(WebCore::GPUDevice::platformDevice):
(WebCore::GPUDevice::layer):

Tools:

Test for WebCore's GPUDevice class.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm: Added.
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsWebCorexcconfig">trunk/Source/WebCore/Configurations/WebCore.xcconfig</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformLoggingh">trunk/Source/WebCore/platform/Logging.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaGPUDeviceMetalmm">trunk/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaWebGPULayerh">trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaWebGPULayermm">trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp">trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh">trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h</a></li>
<li>trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/</li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoremacGPUDevicemm">trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Source/WebCore/ChangeLog        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2017-03-07  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Add GPUDevice implementation and WebGPULayer
+        https://bugs.webkit.org/show_bug.cgi?id=169219
+        &lt;rdar://problem/30879048&gt;
+
+        Reviewed by Sam Weinig.
+
+        Add a basic implementation of a GPUDevice object,
+        which references a MTLDevice. Also add a WebGPULayer
+        that will ultimately be used to host WebGPU content.
+
+        WebKit API Test: WebCore/mac/GPUDevice.mm
+
+        * Configurations/WebCore.xcconfig: Link to Metal.
+
+        * PlatformMac.cmake: New files.
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * platform/Logging.h: Add a WebGPU logging channel.
+
+        * platform/graphics/cocoa/GPUDeviceMetal.mm: Added.
+        (WebCore::GPUDevice::GPUDevice): Cocoa implementation.
+        (WebCore::GPUDevice::reshape):
+        * platform/graphics/cocoa/WebGPULayer.h: Added.
+        * platform/graphics/cocoa/WebGPULayer.mm: Added.
+        (-[WebGPULayer initWithGPUDevice:]):
+        (-[WebGPULayer copyImageSnapshotWithColorSpace:]):
+        (-[WebGPULayer display]):
+        * platform/graphics/gpu/GPUDevice.cpp: Added.
+        (WebCore::GPUDevice::create):
+        (WebCore::GPUDevice::~GPUDevice):
+        (WebCore::GPUDevice::GPUDevice): Implementation for platforms
+        other than Mac and iOS hardware.
+        (WebCore::GPUDevice::reshape):
+        * platform/graphics/gpu/GPUDevice.h: Added.
+        (WebCore::GPUDevice::platformLayer):
+        (WebCore::GPUDevice::platformDevice):
+        (WebCore::GPUDevice::layer):
+
</ins><span class="cx"> 2017-03-07  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] Log an error to the console when an image fails to load
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCorexcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/WebCore.xcconfig        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
</span><span class="cx"> 
</span><span class="cx"> OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_PLATFORM)
</span><del>-OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
</del><ins>+OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework Metal;
</ins><span class="cx"> OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS);
</span><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
</span><span class="cx"> OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios) $(LIBWEBRTC_LDFLAGS);
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Source/WebCore/PlatformMac.cmake        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -107,6 +107,7 @@
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cocoa&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cg&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/cv&quot;
</span><ins>+    &quot;${WEBCORE_DIR}/platform/graphics/gpu&quot;
</ins><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/egl&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opentype&quot;
</span><span class="cx">     &quot;${WEBCORE_DIR}/platform/graphics/opengl&quot;
</span><span class="lines">@@ -414,6 +415,7 @@
</span><span class="cx">     platform/graphics/cg/SubimageCacheWithTimer.cpp
</span><span class="cx">     platform/graphics/cg/TransformationMatrixCG.cpp
</span><span class="cx"> 
</span><ins>+    platform/graphics/cocoa/GPUDeviceMetal.mm
</ins><span class="cx">     platform/graphics/cocoa/FontCacheCoreText.cpp
</span><span class="cx">     platform/graphics/cocoa/FontCascadeCocoa.mm
</span><span class="cx">     platform/graphics/cocoa/FontCocoa.mm
</span><span class="lines">@@ -427,6 +429,8 @@
</span><span class="cx">     platform/graphics/cv/TextureCacheCV.mm
</span><span class="cx">     platform/graphics/cv/VideoTextureCopierCV.cpp
</span><span class="cx"> 
</span><ins>+    platform/graphics/gpu/GPUDevice.cpp
+
</ins><span class="cx">     platform/graphics/mac/ColorMac.mm
</span><span class="cx">     platform/graphics/mac/ComplexTextControllerCoreText.mm
</span><span class="cx">     platform/graphics/mac/DisplayRefreshMonitorMac.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -1352,6 +1352,11 @@
</span><span class="cx">                 314BE3A31B30F6D100141982 /* CSSNamedImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 314BE3A21B30F6D100141982 /* CSSNamedImageValue.cpp */; };
</span><span class="cx">                 314BE3A61B3103FB00141982 /* NamedImageGeneratedImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 314BE3A41B3103FB00141982 /* NamedImageGeneratedImage.cpp */; };
</span><span class="cx">                 314BE3A71B3103FB00141982 /* NamedImageGeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */; };
</span><ins>+                316BDB861E6E0A2700DE0D5A /* GPUDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDB851E6E0A2100DE0D5A /* GPUDevice.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                316BDB871E6E0A2C00DE0D5A /* GPUDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316BDB841E6E0A2100DE0D5A /* GPUDevice.cpp */; };
+                316BDB8B1E6E153000DE0D5A /* WebGPULayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 316BDB891E6E153000DE0D5A /* WebGPULayer.mm */; };
+                316BDB8C1E6E153000DE0D5A /* WebGPULayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDB8A1E6E153000DE0D5A /* WebGPULayer.h */; };
+                316BDB8D1E6E189800DE0D5A /* GPUDeviceMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 316BDB881E6E141C00DE0D5A /* GPUDeviceMetal.mm */; };
</ins><span class="cx">                 316FE0710E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */; };
</span><span class="cx">                 316FE0720E6CCBEE00BF6088 /* JSCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */; };
</span><span class="cx">                 316FE0730E6CCBEE00BF6088 /* JSCSSKeyframesRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316FE06F0E6CCBEE00BF6088 /* JSCSSKeyframesRule.cpp */; };
</span><span class="lines">@@ -8664,6 +8669,11 @@
</span><span class="cx">                 314BE3A21B30F6D100141982 /* CSSNamedImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSNamedImageValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 314BE3A41B3103FB00141982 /* NamedImageGeneratedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NamedImageGeneratedImage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 314BE3A51B3103FB00141982 /* NamedImageGeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NamedImageGeneratedImage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                316BDB841E6E0A2100DE0D5A /* GPUDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GPUDevice.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                316BDB851E6E0A2100DE0D5A /* GPUDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUDevice.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                316BDB881E6E141C00DE0D5A /* GPUDeviceMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUDeviceMetal.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                316BDB891E6E153000DE0D5A /* WebGPULayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGPULayer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                316BDB8A1E6E153000DE0D5A /* WebGPULayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGPULayer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframeRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSKeyframeRule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 316FE06F0E6CCBEE00BF6088 /* JSCSSKeyframesRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframesRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17436,6 +17446,8 @@
</span><span class="cx">                 498770C11242C50D002226BA /* gpu */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                316BDB841E6E0A2100DE0D5A /* GPUDevice.cpp */,
+                                316BDB851E6E0A2100DE0D5A /* GPUDevice.h */,
</ins><span class="cx">                                 498770D71242C535002226BA /* Texture.cpp */,
</span><span class="cx">                                 498770D81242C535002226BA /* Texture.h */,
</span><span class="cx">                                 498770D91242C535002226BA /* TilingData.cpp */,
</span><span class="lines">@@ -22527,6 +22539,7 @@
</span><span class="cx">                                 B2AFFC780D00A5C10030074D /* FontCascadeCocoa.mm */,
</span><span class="cx">                                 7C4EDD731A7B607800198C4D /* FontCocoa.mm */,
</span><span class="cx">                                 B5320D6A122A24E9002D1440 /* FontPlatformDataCocoa.mm */,
</span><ins>+                                316BDB881E6E141C00DE0D5A /* GPUDeviceMetal.mm */,
</ins><span class="cx">                                 2D0B4AA918DA1CCD00434DE1 /* IOSurface.h */,
</span><span class="cx">                                 2D0B4AAA18DA1CCD00434DE1 /* IOSurface.mm */,
</span><span class="cx">                                 AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */,
</span><span class="lines">@@ -22536,6 +22549,8 @@
</span><span class="cx">                                 2D3EF4451917915C00034184 /* WebActionDisablingCALayerDelegate.mm */,
</span><span class="cx">                                 2D3EF4461917915C00034184 /* WebCoreCALayerExtras.h */,
</span><span class="cx">                                 2D3EF4471917915C00034184 /* WebCoreCALayerExtras.mm */,
</span><ins>+                                316BDB891E6E153000DE0D5A /* WebGPULayer.mm */,
+                                316BDB8A1E6E153000DE0D5A /* WebGPULayer.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -27195,6 +27210,7 @@
</span><span class="cx">                                 19BFF64F11C0F2AC00B8C04D /* JSSVGFEConvolveMatrixElement.h in Headers */,
</span><span class="cx">                                 B2FA3D730AB75A6F000E5AC4 /* JSSVGFEDiffuseLightingElement.h in Headers */,
</span><span class="cx">                                 B2FA3D750AB75A6F000E5AC4 /* JSSVGFEDisplacementMapElement.h in Headers */,
</span><ins>+                                316BDB8C1E6E153000DE0D5A /* WebGPULayer.h in Headers */,
</ins><span class="cx">                                 B2FA3D770AB75A6F000E5AC4 /* JSSVGFEDistantLightElement.h in Headers */,
</span><span class="cx">                                 4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */,
</span><span class="cx">                                 B2FA3D790AB75A6F000E5AC4 /* JSSVGFEFloodElement.h in Headers */,
</span><span class="lines">@@ -27547,6 +27563,7 @@
</span><span class="cx">                                 D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
</span><span class="cx">                                 D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
</span><span class="cx">                                 9493B6C11D74B4120088E780 /* MediaQueryParser.h in Headers */,
</span><ins>+                                316BDB861E6E0A2700DE0D5A /* GPUDevice.h in Headers */,
</ins><span class="cx">                                 C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
</span><span class="cx">                                 CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
</span><span class="cx">                                 CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */,
</span><span class="lines">@@ -29921,6 +29938,7 @@
</span><span class="cx">                                 62CD32591157E57C0063B0A7 /* CustomEvent.cpp in Sources */,
</span><span class="cx">                                 97BC6A201505F081001B74AC /* Database.cpp in Sources */,
</span><span class="cx">                                 97BC6A231505F081001B74AC /* DatabaseAuthorizer.cpp in Sources */,
</span><ins>+                                316BDB8B1E6E153000DE0D5A /* WebGPULayer.mm in Sources */,
</ins><span class="cx">                                 97BC6A271505F081001B74AC /* DatabaseContext.cpp in Sources */,
</span><span class="cx">                                 FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */,
</span><span class="cx">                                 1ACB2B231A5733F400333392 /* DatabaseProvider.cpp in Sources */,
</span><span class="lines">@@ -30502,6 +30520,7 @@
</span><span class="cx">                                 A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */,
</span><span class="cx">                                 71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */,
</span><span class="cx">                                 A5071E801C506B66009951BE /* InspectorMemoryAgent.cpp in Sources */,
</span><ins>+                                316BDB8D1E6E189800DE0D5A /* GPUDeviceMetal.mm in Sources */,
</ins><span class="cx">                                 82AB1775125C826700C5069D /* InspectorNetworkAgent.cpp in Sources */,
</span><span class="cx">                                 504AACCD1834455900E3D9BC /* InspectorNodeFinder.cpp in Sources */,
</span><span class="cx">                                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
</span><span class="lines">@@ -31461,6 +31480,7 @@
</span><span class="cx">                                 07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */,
</span><span class="cx">                                 CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */,
</span><span class="cx">                                 CD60C0C6193E87C7003C656B /* MediaTimeQTKit.mm in Sources */,
</span><ins>+                                316BDB871E6E0A2C00DE0D5A /* GPUDevice.cpp in Sources */,
</ins><span class="cx">                                 932CC0F71DFFDA1F004C0F9F /* MediaTrackConstraints.cpp in Sources */,
</span><span class="cx">                                 99C7CCB518C6B8990032E413 /* MemoizedDOMResult.cpp in Sources */,
</span><span class="cx">                                 51E1BAC21BD8064E0055D81F /* MemoryBackingStoreTransaction.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLoggingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Logging.h (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Logging.h        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Source/WebCore/platform/Logging.h        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -87,6 +87,7 @@
</span><span class="cx">     M(URLParser) \
</span><span class="cx">     M(WebAudio) \
</span><span class="cx">     M(WebGL) \
</span><ins>+    M(WebGPU) \
</ins><span class="cx">     M(WebRTC) \
</span><span class="cx">     M(WebReplay) \
</span><span class="cx">     M(WheelEventTestTriggers) \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaGPUDeviceMetalmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GPUDeviceMetal.mm        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;GPUDevice.h&quot;
+
+#import &quot;Logging.h&quot;
+#import &quot;WebGPULayer.h&quot;
+
+#import &lt;Metal/Metal.h&gt;
+#import &lt;runtime/ArrayBuffer.h&gt;
+#import &lt;wtf/BlockObjCExceptions.h&gt;
+
+#if ENABLE(WEBGPU) &amp;&amp; !PLATFORM(IOS_SIMULATOR)
+
+namespace WebCore {
+
+GPUDevice::GPUDevice()
+{
+    m_device = MTLCreateSystemDefaultDevice();
+    LOG(WebGPU, &quot;GPUDevice::GPUDevice Metal device is %p&quot;, m_device.get());
+
+    if (!m_device) {
+        LOG(WebGPU, &quot;GPUDevice::GPUDevice -- could not create the device&quot;);
+        return;
+    }
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS
+    m_layer = [[WebGPULayer alloc] initWithGPUDevice:this];
+    [m_layer setOpaque:0];
+    [m_layer setName:@&quot;WebGPU Layer&quot;];
+
+    // FIXME: WebGPU - Should this be in the WebGPULayer initializer?
+    [m_layer setDevice:(id&lt;MTLDevice&gt;)m_device.get()];
+    [m_layer setPixelFormat:MTLPixelFormatBGRA8Unorm];
+    [m_layer setFramebufferOnly:YES];
+    END_BLOCK_OBJC_EXCEPTIONS
+}
+
+void GPUDevice::reshape(int width, int height)
+{
+    if (!m_device)
+        return;
+
+    if (m_layer) {
+        [m_layer setBounds:CGRectMake(0, 0, width, height)];
+        [m_layer setDrawableSize:CGSizeMake(width, height)];
+    }
+
+    // FIXME: WebGPU - Lots of reshape stuff should go here. See GC3D.
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaWebGPULayerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.h (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.h        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGPU)
+
+#import &lt;Metal/Metal.h&gt;
+#import &lt;QuartzCore/QuartzCore.h&gt;
+
+namespace WebCore {
+class GPUDevice;
+}
+
+#if !PLATFORM(IOS_SIMULATOR)
+@interface WebGPULayer : CAMetalLayer {
+#else
+@interface WebGPULayer : CALayer { // FIXME: WebGPU - Disable WebGPU on iOS simulator?
+#endif
+    WebCore::GPUDevice* _context;
+    float _devicePixelRatio;
+}
+
+@property (nonatomic) WebCore::GPUDevice* context;
+
+- (id)initWithGPUDevice:(WebCore::GPUDevice*)context;
+
+- (CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace;
+
+@end
+
+#endif
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Author Id Revision HeadURL
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoreplatformgraphicscocoaWebGPULayermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#import &quot;WebGPULayer.h&quot;
+
+#if ENABLE(WEBGPU)
+
+#import &quot;GPUDevice.h&quot;
+#import &quot;GraphicsContextCG.h&quot;
+#import &quot;GraphicsLayer.h&quot;
+#import &lt;wtf/FastMalloc.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+using namespace WebCore;
+
+@implementation WebGPULayer
+
+@synthesize context=_context;
+
+- (id)initWithGPUDevice:(GPUDevice*)context
+{
+    self = [super init];
+    _context = context;
+
+    // FIXME: WebGPU - handle retina correctly.
+    _devicePixelRatio = 1;
+
+#if PLATFORM(MAC)
+    self.contentsScale = _devicePixelRatio;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+    if ([self respondsToSelector:@selector(setColorspace:)])
+        [self setColorspace:sRGBColorSpaceRef()];
+#endif
+#endif
+    return self;
+}
+
+- (CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace
+{
+    if (!_context)
+        return nullptr;
+
+    UNUSED_PARAM(colorSpace);
+    return nullptr;
+}
+
+- (void)display
+{
+    // This is a no-op. We don't need to
+    // call display - instead we present
+    // a drawable from our context.
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;GPUDevice.h&quot;
+
+#if ENABLE(WEBGPU)
+
+#import &quot;Logging.h&quot;
+
+namespace WebCore {
+
+RefPtr&lt;GPUDevice&gt; GPUDevice::create()
+{
+    RefPtr&lt;GPUDevice&gt; device = adoptRef(new GPUDevice());
+    LOG(WebGPU, &quot;GPUDevice::create() device is %p&quot;, device.get());
+    return device;
+}
+
+GPUDevice::~GPUDevice()
+{
+    LOG(WebGPU, &quot;GPUDevice::~GPUDevice()&quot;);
+}
+
+#if !PLATFORM(COCOA) || PLATFORM(IOS_SIMULATOR)
+
+GPUDevice::GPUDevice()
+{
+
+}
+
+void GPUDevice::reshape(int, int)
+{
+}
+
+#endif
+
+} // namespace WebCore
+
+#endif
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Author Id Revision HeadURL
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGPU)
+
+#include &quot;PlatformLayer.h&quot;
+#include &lt;runtime/ArrayBufferView.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+#if USE(CA)
+#include &quot;PlatformCALayer.h&quot;
+#endif
+
+#if PLATFORM(COCOA)
+typedef struct objc_object* id;
+OBJC_CLASS CALayer;
+OBJC_CLASS WebGPULayer;
+#else
+class WebGPULayer;
+typedef void PlatformGPUDevice;
+#endif
+
+namespace WebCore {
+
+class GPUDevice : public RefCounted&lt;GPUDevice&gt; {
+public:
+
+    WEBCORE_EXPORT static RefPtr&lt;GPUDevice&gt; create();
+    WEBCORE_EXPORT ~GPUDevice();
+
+    void reshape(int width, int height);
+
+#if PLATFORM(COCOA)
+    CALayer* platformLayer() const { return reinterpret_cast&lt;CALayer*&gt;(m_layer.get()); }
+    WEBCORE_EXPORT id platformDevice() { return m_device.get(); }
+#endif
+
+    WebGPULayer* layer() { return m_layer.get(); }
+
+private:
+    GPUDevice();
+
+    RetainPtr&lt;WebGPULayer&gt; m_layer;
+#if PLATFORM(COCOA)
+    RetainPtr&lt;id&gt; m_device;
+#endif
+};
+
+} // namespace WebCore
+
+#endif
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Author Id Revision HeadURL
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Tools/ChangeLog        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2017-03-07  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Add GPUDevice implementation and WebGPULayer
+        https://bugs.webkit.org/show_bug.cgi?id=169219
+        &lt;rdar://problem/30879048&gt;
+
+        Reviewed by Sam Weinig.
+
+        Test for WebCore's GPUDevice class.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm: Added.
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2017-03-07  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Extensions] Rename &quot;Domain&quot; to &quot;Condition&quot; where appropriate
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (213540 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-03-07 22:22:32 UTC (rev 213540)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx">                 2EFF06D41D8AEDBB0004BB30 /* TestWKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EFF06D31D8AEDBB0004BB30 /* TestWKWebView.mm */; };
</span><span class="cx">                 2EFF06D71D8AF34A0004BB30 /* WKWebViewCandidateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EFF06D61D8AF34A0004BB30 /* WKWebViewCandidateTests.mm */; };
</span><span class="cx">                 315118101DB1AE4000176304 /* ExtendedColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */; };
</span><ins>+                3162AE9C1E6F2FF5000E4DBC /* GPUDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3162AE9B1E6F2FCE000E4DBC /* GPUDevice.mm */; };
</ins><span class="cx">                 33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; };
</span><span class="cx">                 33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33DC890E1419539300747EF7 /* simple-iframe.html */; };
</span><span class="cx">                 33DC89141419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33DC89131419579F00747EF7 /* LoadCanceledNoServerRedirectCallback_Bundle.cpp */; };
</span><span class="lines">@@ -946,6 +947,7 @@
</span><span class="cx">                 2EFF06D31D8AEDBB0004BB30 /* TestWKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestWKWebView.mm; path = cocoa/TestWKWebView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EFF06D61D8AF34A0004BB30 /* WKWebViewCandidateTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewCandidateTests.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtendedColor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3162AE9B1E6F2FCE000E4DBC /* GPUDevice.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUDevice.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1660,21 +1662,23 @@
</span><span class="cx">                         path = ios;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                3162AE9A1E6F2F8F000E4DBC /* mac */ = {
+                        isa = PBXGroup;
+                        children = (
+                                3162AE9B1E6F2FCE000E4DBC /* GPUDevice.mm */,
+                        );
+                        path = mac;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 440A1D3614A01000008A66F2 /* WebCore */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                8E4A85361E1D1AA100F53B0F /* GridPosition.cpp */,
-                                CD89D0371C4EDB1300040A04 /* cocoa */,
</del><span class="cx">                                 7A909A6F1D877475007E10F8 /* AffineTransform.cpp */,
</span><ins>+                                93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
</ins><span class="cx">                                 07C046C91E42573E007201E7 /* CARingBuffer.cpp */,
</span><del>-                                7A909A701D877475007E10F8 /* FloatPoint.cpp */,
-                                7A909A711D877475007E10F8 /* FloatRect.cpp */,
-                                7A909A721D877475007E10F8 /* FloatSize.cpp */,
-                                7A909A731D877475007E10F8 /* IntPoint.cpp */,
-                                7A909A741D877475007E10F8 /* IntRect.cpp */,
-                                7A909A751D877475007E10F8 /* IntSize.cpp */,
-                                93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
</del><ins>+                                CD89D0371C4EDB1300040A04 /* cocoa */,
</ins><span class="cx">                                 7C3965051CDD74F90094DBB8 /* Color.cpp */,
</span><ins>+                                1C9EB8401E380DA1005C6442 /* ComplexTextController.cpp */,
</ins><span class="cx">                                 7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */,
</span><span class="cx">                                 CD5451E919E41F9D0016936F /* CSSParser.cpp */,
</span><span class="cx">                                 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */,
</span><span class="lines">@@ -1682,8 +1686,17 @@
</span><span class="cx">                                 26F6E1EF1ADC749B00DE696B /* DFAMinimizer.cpp */,
</span><span class="cx">                                 3151180F1DB1ADD500176304 /* ExtendedColor.cpp */,
</span><span class="cx">                                 41973B5A1AF2286A006C7B36 /* FileSystem.cpp */,
</span><ins>+                                7A909A701D877475007E10F8 /* FloatPoint.cpp */,
+                                7A909A711D877475007E10F8 /* FloatRect.cpp */,
+                                7A909A721D877475007E10F8 /* FloatSize.cpp */,
+                                1CAD1F851E5CE7DA00AF2C2C /* FontCache.cpp */,
+                                8E4A85361E1D1AA100F53B0F /* GridPosition.cpp */,
</ins><span class="cx">                                 83B88A331C80056D00BB2418 /* HTMLParserIdioms.cpp */,
</span><ins>+                                7A909A731D877475007E10F8 /* IntPoint.cpp */,
+                                7A909A741D877475007E10F8 /* IntRect.cpp */,
+                                7A909A751D877475007E10F8 /* IntSize.cpp */,
</ins><span class="cx">                                 14464012167A8305000BD218 /* LayoutUnit.cpp */,
</span><ins>+                                3162AE9A1E6F2F8F000E4DBC /* mac */,
</ins><span class="cx">                                 CD225C071C45A69200140761 /* ParsedContentRange.cpp */,
</span><span class="cx">                                 CDCFA7A91E45122F00C2433D /* SampleMap.cpp */,
</span><span class="cx">                                 CE06DF9A1E1851F200E570C9 /* SecurityOrigin.cpp */,
</span><span class="lines">@@ -1696,8 +1709,6 @@
</span><span class="cx">                                 440A1D3814A0103A008A66F2 /* URL.cpp */,
</span><span class="cx">                                 5C6E65411D5CEF8500F7862E /* URLParser.cpp */,
</span><span class="cx">                                 9C64DC311D76198A004B598E /* YouTubePluginReplacement.cpp */,
</span><del>-                                1C9EB8401E380DA1005C6442 /* ComplexTextController.cpp */,
-                                1CAD1F851E5CE7DA00AF2C2C /* FontCache.cpp */,
</del><span class="cx">                         );
</span><span class="cx">                         path = WebCore;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -2768,6 +2779,7 @@
</span><span class="cx">                                 2DB0232F1E4E871800707123 /* InteractionDeadlockAfterCrash.mm in Sources */,
</span><span class="cx">                                 7CCE7F071A411AE600447C4C /* PageLoadBasic.cpp in Sources */,
</span><span class="cx">                                 7CCE7F081A411AE600447C4C /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */,
</span><ins>+                                3162AE9C1E6F2FF5000E4DBC /* GPUDevice.mm in Sources */,
</ins><span class="cx">                                 7CCE7EC71A411A7E00447C4C /* PageVisibilityStateWithWindowChanges.mm in Sources */,
</span><span class="cx">                                 7CCE7F091A411AE600447C4C /* ParentFrame.cpp in Sources */,
</span><span class="cx">                                 AD57AC211DA7465B00FF1BDE /* DidRemoveFrameFromHiearchyInPageCache.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoremacGPUDevicemm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm (0 => 213541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUDevice.mm        2017-03-07 22:23:33 UTC (rev 213541)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef ENABLE_WEBGPU
+
+#include &quot;config.h&quot;
+#import &quot;Test.h&quot;
+#import &lt;Metal/Metal.h&gt;
+#import &lt;WebCore/GPUDevice.h&gt;
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+TEST(GPU, Basic)
+{
+    auto device = GPUDevice::create();
+    EXPECT_NOT_NULL(device-&gt;layer());
+    EXPECT_NOT_NULL(device-&gt;platformLayer());
+
+    id&lt;MTLDevice&gt; mtlDevice = (id&lt;MTLDevice&gt;)device-&gt;platformDevice();
+    EXPECT_NOT_NULL(mtlDevice);
+
+    NSString *deviceName = mtlDevice.name;
+    EXPECT_GT(deviceName.length, static_cast&lt;unsigned long&gt;(0));
+}
+
+} // namespace TestWebKitAPI
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>