<!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>[213731] trunk/Source/WebCore</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/213731">213731</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2017-03-10 14:56:06 -0800 (Fri, 10 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>WebGPU: Backend - Textures and TextureDescriptors
https://bugs.webkit.org/show_bug.cgi?id=169365
<rdar://problem/30928716>
Reviewed by Jon Lee with help from Anders Carlsson.
Backend implementation of textures for WebGPU, which adds
the GPUTexture and GPUTextureDescriptor classes, as well
as a creation method on GPUDevice.
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cocoa/GPUTextureDescriptorMetal.mm: Added.
(WebCore::GPUTextureDescriptor::GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
(WebCore::GPUTextureDescriptor::platformTextureDescriptor):
* platform/graphics/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
(WebCore::GPUTexture::platformTexture):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createTexture):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::createFromExistingTexture):
(WebCore::GPUTexture::~GPUTexture):
(WebCore::GPUTexture::width):
(WebCore::GPUTexture::height):
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
(WebCore::GPUTextureDescriptor::create):
(WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
(WebCore::GPUTextureDescriptor::width):
(WebCore::GPUTextureDescriptor::setWidth):
(WebCore::GPUTextureDescriptor::height):
(WebCore::GPUTextureDescriptor::setHeight):
(WebCore::GPUTextureDescriptor::sampleCount):
(WebCore::GPUTextureDescriptor::setSampleCount):
(WebCore::GPUTextureDescriptor::textureType):
(WebCore::GPUTextureDescriptor::setTextureType):
(WebCore::GPUTextureDescriptor::storageMode):
(WebCore::GPUTextureDescriptor::setStorageMode):
(WebCore::GPUTextureDescriptor::usage):
(WebCore::GPUTextureDescriptor::setUsage):
* platform/graphics/gpu/GPUTextureDescriptor.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#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>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaGPUTextureDescriptorMetalmm">trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureDescriptorMetal.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaGPUTextureMetalmm">trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUTexturecpp">trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUTextureh">trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUTextureDescriptorcpp">trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgpuGPUTextureDescriptorh">trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213730 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-10 22:43:01 UTC (rev 213730)
+++ trunk/Source/WebCore/ChangeLog        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2017-03-10 Dean Jackson <dino@apple.com>
+
+ WebGPU: Backend - Textures and TextureDescriptors
+ https://bugs.webkit.org/show_bug.cgi?id=169365
+ <rdar://problem/30928716>
+
+ Reviewed by Jon Lee with help from Anders Carlsson.
+
+ Backend implementation of textures for WebGPU, which adds
+ the GPUTexture and GPUTextureDescriptor classes, as well
+ as a creation method on GPUDevice.
+
+ * PlatformMac.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/cocoa/GPUTextureDescriptorMetal.mm: Added.
+ (WebCore::GPUTextureDescriptor::GPUTextureDescriptor):
+ (WebCore::GPUTextureDescriptor::width):
+ (WebCore::GPUTextureDescriptor::setWidth):
+ (WebCore::GPUTextureDescriptor::height):
+ (WebCore::GPUTextureDescriptor::setHeight):
+ (WebCore::GPUTextureDescriptor::sampleCount):
+ (WebCore::GPUTextureDescriptor::setSampleCount):
+ (WebCore::GPUTextureDescriptor::textureType):
+ (WebCore::GPUTextureDescriptor::setTextureType):
+ (WebCore::GPUTextureDescriptor::storageMode):
+ (WebCore::GPUTextureDescriptor::setStorageMode):
+ (WebCore::GPUTextureDescriptor::usage):
+ (WebCore::GPUTextureDescriptor::setUsage):
+ (WebCore::GPUTextureDescriptor::platformTextureDescriptor):
+ * platform/graphics/cocoa/GPUTextureMetal.mm:
+ (WebCore::GPUTexture::GPUTexture):
+ (WebCore::GPUTexture::width):
+ (WebCore::GPUTexture::height):
+ (WebCore::GPUTexture::platformTexture):
+ * platform/graphics/gpu/GPUDevice.cpp:
+ (WebCore::GPUDevice::createTexture):
+ * platform/graphics/gpu/GPUDevice.h:
+ * platform/graphics/gpu/GPUTexture.cpp:
+ (WebCore::GPUTexture::create):
+ (WebCore::GPUTexture::createFromExistingTexture):
+ (WebCore::GPUTexture::~GPUTexture):
+ (WebCore::GPUTexture::width):
+ (WebCore::GPUTexture::height):
+ * platform/graphics/gpu/GPUTexture.h:
+ * platform/graphics/gpu/GPUTextureDescriptor.cpp:
+ (WebCore::GPUTextureDescriptor::create):
+ (WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
+ (WebCore::GPUTextureDescriptor::width):
+ (WebCore::GPUTextureDescriptor::setWidth):
+ (WebCore::GPUTextureDescriptor::height):
+ (WebCore::GPUTextureDescriptor::setHeight):
+ (WebCore::GPUTextureDescriptor::sampleCount):
+ (WebCore::GPUTextureDescriptor::setSampleCount):
+ (WebCore::GPUTextureDescriptor::textureType):
+ (WebCore::GPUTextureDescriptor::setTextureType):
+ (WebCore::GPUTextureDescriptor::storageMode):
+ (WebCore::GPUTextureDescriptor::setStorageMode):
+ (WebCore::GPUTextureDescriptor::usage):
+ (WebCore::GPUTextureDescriptor::setUsage):
+ * platform/graphics/gpu/GPUTextureDescriptor.h:
+
</ins><span class="cx"> 2017-03-10 Per Arne Vollan <pvollan@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] Scrollbars buttons have incorrect size in HiDPI.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (213730 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2017-03-10 22:43:01 UTC (rev 213730)
+++ trunk/Source/WebCore/PlatformMac.cmake        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -427,6 +427,8 @@
</span><span class="cx"> platform/graphics/cocoa/GPUDeviceMetal.mm
</span><span class="cx"> platform/graphics/cocoa/GPUFunctionMetal.mm
</span><span class="cx"> platform/graphics/cocoa/GPULibraryMetal.mm
</span><ins>+ platform/graphics/cocoa/GPUTextureDescriptorMetal.mm
+ platform/graphics/cocoa/GPUTextureMetal.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">@@ -445,6 +447,8 @@
</span><span class="cx"> platform/graphics/gpu/GPUDevice.cpp
</span><span class="cx"> platform/graphics/gpu/GPUFunction.cpp
</span><span class="cx"> platform/graphics/gpu/GPULibrary.cpp
</span><ins>+ platform/graphics/gpu/GPUTexture.cpp
+ platform/graphics/gpu/GPUTextureDescriptor.cpp
</ins><span class="cx">
</span><span class="cx"> platform/graphics/mac/ColorMac.mm
</span><span class="cx"> platform/graphics/mac/ComplexTextControllerCoreText.mm
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (213730 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-10 22:43:01 UTC (rev 213730)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -1374,6 +1374,12 @@
</span><span class="cx">                 316BDBA61E71FA6F00DE0D5A /* GPUBufferMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBA51E71FA6F00DE0D5A /* GPUBufferMetal.mm */; };
</span><span class="cx">                 316BDBA91E71FA9300DE0D5A /* GPUBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBA71E71FA9300DE0D5A /* GPUBuffer.cpp */; };
</span><span class="cx">                 316BDBAA1E71FA9300DE0D5A /* GPUBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDBA81E71FA9300DE0D5A /* GPUBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                316BDBAE1E73549C00DE0D5A /* GPUTextureMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBAD1E73549C00DE0D5A /* GPUTextureMetal.mm */; };
+                316BDBB11E7354BB00DE0D5A /* GPUTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBAF1E7354BB00DE0D5A /* GPUTexture.cpp */; };
+                316BDBB21E7354BB00DE0D5A /* GPUTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDBB01E7354BB00DE0D5A /* GPUTexture.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                316BDBB41E7357B000DE0D5A /* GPUTextureDescriptorMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBB31E7357B000DE0D5A /* GPUTextureDescriptorMetal.mm */; };
+                316BDBB71E7357CB00DE0D5A /* GPUTextureDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 316BDBB51E7357CB00DE0D5A /* GPUTextureDescriptor.cpp */; };
+                316BDBB81E7357CB00DE0D5A /* GPUTextureDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 316BDBB61E7357CB00DE0D5A /* GPUTextureDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</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">@@ -8739,6 +8745,12 @@
</span><span class="cx">                 316BDBA51E71FA6F00DE0D5A /* GPUBufferMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUBufferMetal.mm; sourceTree = "<group>"; };
</span><span class="cx">                 316BDBA71E71FA9300DE0D5A /* GPUBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GPUBuffer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 316BDBA81E71FA9300DE0D5A /* GPUBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUBuffer.h; sourceTree = "<group>"; };
</span><ins>+                316BDBAD1E73549C00DE0D5A /* GPUTextureMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUTextureMetal.mm; sourceTree = "<group>"; };
+                316BDBAF1E7354BB00DE0D5A /* GPUTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GPUTexture.cpp; sourceTree = "<group>"; };
+                316BDBB01E7354BB00DE0D5A /* GPUTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUTexture.h; sourceTree = "<group>"; };
+                316BDBB31E7357B000DE0D5A /* GPUTextureDescriptorMetal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUTextureDescriptorMetal.mm; sourceTree = "<group>"; };
+                316BDBB51E7357CB00DE0D5A /* GPUTextureDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GPUTextureDescriptor.cpp; sourceTree = "<group>"; };
+                316BDBB61E7357CB00DE0D5A /* GPUTextureDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUTextureDescriptor.h; sourceTree = "<group>"; };
</ins><span class="cx">                 316FE06D0E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframeRule.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 316FE06E0E6CCBEE00BF6088 /* JSCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSKeyframeRule.h; sourceTree = "<group>"; };
</span><span class="cx">                 316FE06F0E6CCBEE00BF6088 /* JSCSSKeyframesRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSKeyframesRule.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -17563,6 +17575,10 @@
</span><span class="cx">                                 316BDB931E70C89700DE0D5A /* GPUFunction.h */,
</span><span class="cx">                                 316BDB981E70CBBF00DE0D5A /* GPULibrary.cpp */,
</span><span class="cx">                                 316BDB991E70CBBF00DE0D5A /* GPULibrary.h */,
</span><ins>+                                316BDBB51E7357CB00DE0D5A /* GPUTextureDescriptor.cpp */,
+                                316BDBB61E7357CB00DE0D5A /* GPUTextureDescriptor.h */,
+                                316BDBAF1E7354BB00DE0D5A /* GPUTexture.cpp */,
+                                316BDBB01E7354BB00DE0D5A /* GPUTexture.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">@@ -22658,6 +22674,8 @@
</span><span class="cx">                                 316BDB881E6E141C00DE0D5A /* GPUDeviceMetal.mm */,
</span><span class="cx">                                 316BDB961E70CA2400DE0D5A /* GPUFunctionMetal.mm */,
</span><span class="cx">                                 316BDB9C1E70CD9000DE0D5A /* GPULibraryMetal.mm */,
</span><ins>+                                316BDBB31E7357B000DE0D5A /* GPUTextureDescriptorMetal.mm */,
+                                316BDBAD1E73549C00DE0D5A /* GPUTextureMetal.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">@@ -28577,6 +28595,7 @@
</span><span class="cx">                                 BC2272BD0E82EAAE00E7F975 /* StyleRareNonInheritedData.h in Headers */,
</span><span class="cx">                                 BC2272870E82E70700E7F975 /* StyleReflection.h in Headers */,
</span><span class="cx">                                 E461802D1C8DD2900026C02C /* StyleRelations.h in Headers */,
</span><ins>+                                316BDBB81E7357CB00DE0D5A /* GPUTextureDescriptor.h in Headers */,
</ins><span class="cx">                                 5750A9751E68D00000705C4A /* CryptoKeyEC.h in Headers */,
</span><span class="cx">                                 E4D58EB517B4DBDC00CBDCA8 /* StyleResolveForDocument.h in Headers */,
</span><span class="cx">                                 E139866415478474001E3F65 /* StyleResolver.h in Headers */,
</span><span class="lines">@@ -29289,6 +29308,7 @@
</span><span class="cx">                                 93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
</span><span class="cx">                                 E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
</span><span class="cx">                                 977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
</span><ins>+                                316BDBB21E7354BB00DE0D5A /* GPUTexture.h in Headers */,
</ins><span class="cx">                                 977E2E0F12F0FC9C00C13380 /* XSSAuditorDelegate.h in Headers */,
</span><span class="cx">                                 A5416FE618810EF80009FC5F /* YouTubeEmbedShadowElement.h in Headers */,
</span><span class="cx">                                 7A5515F5191830A3009687D2 /* YouTubePluginReplacement.h in Headers */,
</span><span class="lines">@@ -30153,6 +30173,7 @@
</span><span class="cx">                                 0F97A658155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm in Sources */,
</span><span class="cx">                                 49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */,
</span><span class="cx">                                 2D29ECC7192ECC8300984B78 /* DisplayRefreshMonitorManager.cpp in Sources */,
</span><ins>+                                316BDBAE1E73549C00DE0D5A /* GPUTextureMetal.mm in Sources */,
</ins><span class="cx">                                 CD52481A18E200ED0008A07D /* DisplaySleepDisabler.cpp in Sources */,
</span><span class="cx">                                 5D8C4DBF1428222C0026CE72 /* DisplaySleepDisablerCocoa.cpp in Sources */,
</span><span class="cx">                                 FD31609012B026F700C1A359 /* Distance.cpp in Sources */,
</span><span class="lines">@@ -30678,6 +30699,7 @@
</span><span class="cx">                                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
</span><span class="cx">                                 4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */,
</span><span class="cx">                                 99CC0B6618BE9F15006CEBCC /* InspectorReplayAgent.cpp in Sources */,
</span><ins>+                                316BDBB41E7357B000DE0D5A /* GPUTextureDescriptorMetal.mm in Sources */,
</ins><span class="cx">                                 82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
</span><span class="cx">                                 754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
</span><span class="cx">                                 A54A0C5D1DB6D9C00017A90B /* InspectorWorkerAgent.cpp in Sources */,
</span><span class="lines">@@ -31865,6 +31887,7 @@
</span><span class="cx">                                 1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */,
</span><span class="cx">                                 1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */,
</span><span class="cx">                                 FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */,
</span><ins>+                                316BDBB11E7354BB00DE0D5A /* GPUTexture.cpp in Sources */,
</ins><span class="cx">                                 0081FEFF16B0A2B6008AAA7A /* PublicSuffixMac.mm in Sources */,
</span><span class="cx">                                 CDEE393717974259001D7580 /* PublicURLManager.cpp in Sources */,
</span><span class="cx">                                 550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
</span><span class="lines">@@ -32668,6 +32691,7 @@
</span><span class="cx">                                 AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */,
</span><span class="cx">                                 AA478A8016CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm in Sources */,
</span><span class="cx">                                 2D3EF4491917915C00034184 /* WebActionDisablingCALayerDelegate.mm in Sources */,
</span><ins>+                                316BDBB71E7357CB00DE0D5A /* GPUTextureDescriptor.cpp in Sources */,
</ins><span class="cx">                                 120DE3ED1C86CA3E00B6D4DD /* WebAnimation.cpp in Sources */,
</span><span class="cx">                                 CDE667A41E4BBF1500E8154A /* WebAudioBufferList.cpp in Sources */,
</span><span class="cx">                                 07D637411BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaGPUTextureDescriptorMetalmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureDescriptorMetal.mm (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureDescriptorMetal.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureDescriptorMetal.mm        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,129 @@
</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.
+ */
+
+#include "config.h"
+#include "GPUTextureDescriptor.h"
+
+#if ENABLE(WEBGPU)
+
+#import "Logging.h"
+
+#import <Metal/Metal.h>
+
+namespace WebCore {
+
+GPUTextureDescriptor::GPUTextureDescriptor(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped)
+{
+ LOG(WebGPU, "GPUTextureDescriptor::GPUTextureDescriptor()");
+
+ m_textureDescriptor = (MTLTextureDescriptor*)[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:static_cast<MTLPixelFormat>(pixelFormat) width:width height:height mipmapped:mipmapped];
+}
+
+unsigned long GPUTextureDescriptor::width() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor width];
+}
+
+void GPUTextureDescriptor::setWidth(unsigned long newWidth)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setWidth:newWidth];
+}
+
+unsigned long GPUTextureDescriptor::height() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor height];
+}
+
+void GPUTextureDescriptor::setHeight(unsigned long newHeight)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setHeight:newHeight];
+}
+
+unsigned long GPUTextureDescriptor::sampleCount() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor sampleCount];
+}
+
+void GPUTextureDescriptor::setSampleCount(unsigned long newSampleCount)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setSampleCount:newSampleCount];
+}
+
+unsigned long GPUTextureDescriptor::textureType() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor textureType];
+}
+
+void GPUTextureDescriptor::setTextureType(unsigned long newTextureType)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setTextureType:static_cast<MTLTextureType>(newTextureType)];
+}
+
+unsigned long GPUTextureDescriptor::storageMode() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor storageMode];
+}
+
+void GPUTextureDescriptor::setStorageMode(unsigned long newStorageMode)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setStorageMode:static_cast<MTLStorageMode>(newStorageMode)];
+}
+
+unsigned long GPUTextureDescriptor::usage() const
+{
+ if (!m_textureDescriptor)
+ return 0;
+ return [m_textureDescriptor usage];
+}
+
+void GPUTextureDescriptor::setUsage(unsigned long newUsage)
+{
+ ASSERT(m_textureDescriptor);
+ [m_textureDescriptor setUsage:newUsage];
+}
+
+MTLTextureDescriptor* GPUTextureDescriptor::platformTextureDescriptor()
+{
+ return m_textureDescriptor.get();
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaGPUTextureMetalmmfromrev213730trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm (from rev 213730, trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp) (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GPUTextureMetal.mm        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,84 @@
</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.
+ */
+
+#include "config.h"
+#include "GPUTexture.h"
+
+#if ENABLE(WEBGPU)
+
+#import "GPUDevice.h"
+#import "GPUTextureDescriptor.h"
+#import "Logging.h"
+
+#import <Metal/Metal.h>
+
+namespace WebCore {
+
+GPUTexture::GPUTexture(GPUDevice* device, GPUTextureDescriptor* descriptor)
+{
+ LOG(WebGPU, "GPUTexture::GPUTexture()");
+
+ if (!device || !device->platformDevice() || !descriptor || !descriptor->platformTextureDescriptor())
+ return;
+
+ m_texture = (MTLTexture*)[device->platformDevice() newTextureWithDescriptor:descriptor->platformTextureDescriptor()];
+}
+
+GPUTexture::GPUTexture(GPUTexture* other)
+{
+ LOG(WebGPU, "GPUTexture::GPUTexture()");
+
+ if (!other || !other->platformTexture())
+ return;
+
+ m_texture = other->platformTexture();
+}
+
+unsigned long GPUTexture::width() const
+{
+ if (!m_texture)
+ return 0;
+
+ id<MTLTexture> texture = static_cast<id<MTLTexture>>(m_texture.get());
+ return texture.width;
+}
+
+unsigned long GPUTexture::height() const
+{
+ if (!m_texture)
+ return 0;
+
+ id<MTLTexture> texture = static_cast<id<MTLTexture>>(m_texture.get());
+ return texture.height;
+}
+
+MTLTexture* GPUTexture::platformTexture()
+{
+ return m_texture.get();
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp (213730 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp        2017-03-10 22:43:01 UTC (rev 213730)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx">
</span><span class="cx"> #include "GPUBuffer.h"
</span><span class="cx"> #include "GPULibrary.h"
</span><ins>+#include "GPUTexture.h"
+#include "GPUTextureDescriptor.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -64,6 +66,11 @@
</span><span class="cx"> return GPUBuffer::create(this, data);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RefPtr<GPUTexture> GPUDevice::createTexture(GPUTextureDescriptor* descriptor)
+{
+ return GPUTexture::create(this, descriptor);
+}
+
</ins><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx">
</span><span class="cx"> GPUDevice::GPUDevice()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h (213730 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h        2017-03-10 22:43:01 UTC (rev 213730)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx">
</span><span class="cx"> class GPUBuffer;
</span><span class="cx"> class GPULibrary;
</span><ins>+class GPUTexture;
+class GPUTextureDescriptor;
</ins><span class="cx">
</span><span class="cx"> class GPUDevice : public RefCounted<GPUDevice> {
</span><span class="cx"> public:
</span><span class="lines">@@ -65,6 +67,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT RefPtr<GPULibrary> createLibrary(const String& sourceCode);
</span><span class="cx"> WEBCORE_EXPORT RefPtr<GPUBuffer> createBufferFromData(ArrayBufferView* data);
</span><ins>+ WEBCORE_EXPORT RefPtr<GPUTexture> createTexture(GPUTextureDescriptor*);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> GPUDevice();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUTexturecppfromrev213730trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.cpp (from rev 213730, trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp) (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.cpp        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,67 @@
</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.
+ */
+
+#include "config.h"
+#include "GPUTexture.h"
+
+#if ENABLE(WEBGPU)
+
+#import "GPUDevice.h"
+#import "Logging.h"
+
+namespace WebCore {
+
+RefPtr<GPUTexture> GPUTexture::create(GPUDevice* device, GPUTextureDescriptor* descriptor)
+{
+ RefPtr<GPUTexture> texture = adoptRef(new GPUTexture(device, descriptor));
+ return texture;
+}
+
+RefPtr<GPUTexture> GPUTexture::createFromExistingTexture(GPUTexture* other)
+{
+ RefPtr<GPUTexture> texture = adoptRef(new GPUTexture(other));
+ return texture;
+}
+
+GPUTexture::~GPUTexture()
+{
+ LOG(WebGPU, "GPUTexture::~GPUTexture()");
+}
+
+#if !PLATFORM(COCOA)
+unsigned long GPUTexture::width() const
+{
+ return 0;
+}
+
+unsigned long GPUTexture::height() const
+{
+ return 0;
+}
+#endif
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUTexturehfromrev213730trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h (from rev 213730, trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h) (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTexture.h        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,66 @@
</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 <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
+
+#if PLATFORM(COCOA)
+OBJC_CLASS MTLTexture;
+#endif
+
+namespace WebCore {
+
+class GPUDevice;
+class GPUTextureDescriptor;
+
+class GPUTexture : public RefCounted<GPUTexture> {
+public:
+ static RefPtr<GPUTexture> create(GPUDevice*, GPUTextureDescriptor*);
+ static RefPtr<GPUTexture> createFromExistingTexture(GPUTexture*);
+ WEBCORE_EXPORT ~GPUTexture();
+
+ WEBCORE_EXPORT unsigned long width() const;
+ WEBCORE_EXPORT unsigned long height() const;
+
+#if PLATFORM(COCOA)
+ WEBCORE_EXPORT MTLTexture* platformTexture();
+#endif
+
+private:
+ GPUTexture(GPUDevice*, GPUTextureDescriptor*);
+ GPUTexture(GPUTexture*);
+
+#if PLATFORM(COCOA)
+ RetainPtr<MTLTexture> m_texture;
+#endif
+};
+
+} // namespace WebCore
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUTextureDescriptorcppfromrev213730trunkSourceWebCoreplatformgraphicsgpuGPUDevicecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.cpp (from rev 213730, trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.cpp) (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.cpp        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,104 @@
</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.
+ */
+
+#include "config.h"
+#include "GPUTextureDescriptor.h"
+
+#if ENABLE(WEBGPU)
+
+#import "Logging.h"
+
+namespace WebCore {
+
+RefPtr<GPUTextureDescriptor> GPUTextureDescriptor::create(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped)
+{
+ RefPtr<GPUTextureDescriptor> descriptor = adoptRef(new GPUTextureDescriptor(pixelFormat, width, height, mipmapped));
+ return descriptor;
+}
+
+GPUTextureDescriptor::~GPUTextureDescriptor()
+{
+ LOG(WebGPU, "GPUTextureDescriptor::~GPUTextureDescriptor()");
+}
+
+#if !PLATFORM(COCOA)
+unsigned long GPUTextureDescriptor::width() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setWidth(unsigned long)
+{
+}
+
+unsigned long GPUTextureDescriptor::height() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setHeight(unsigned long)
+{
+}
+
+unsigned long GPUTextureDescriptor::sampleCount() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setSampleCount(unsigned long)
+{
+}
+
+unsigned long GPUTextureDescriptor::textureType() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setTextureType(unsigned long)
+{
+}
+
+unsigned long GPUTextureDescriptor::storageMode() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setStorageMode(unsigned long)
+{
+}
+
+unsigned long GPUTextureDescriptor::usage() const
+{
+ return 0;
+}
+
+void GPUTextureDescriptor::setUsage(unsigned long)
+{
+}
+#endif
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgpuGPUTextureDescriptorhfromrev213730trunkSourceWebCoreplatformgraphicsgpuGPUDeviceh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h (from rev 213730, trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h) (0 => 213731)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUTextureDescriptor.h        2017-03-10 22:56:06 UTC (rev 213731)
</span><span class="lines">@@ -0,0 +1,76 @@
</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 <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/RetainPtr.h>
+
+#if PLATFORM(COCOA)
+OBJC_CLASS MTLTextureDescriptor;
+#endif
+
+namespace WebCore {
+
+class GPUTextureDescriptor : public RefCounted<GPUTextureDescriptor> {
+public:
+ static RefPtr<GPUTextureDescriptor> create(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped);
+ WEBCORE_EXPORT ~GPUTextureDescriptor();
+
+ WEBCORE_EXPORT unsigned long width() const;
+ WEBCORE_EXPORT void setWidth(unsigned long);
+
+ WEBCORE_EXPORT unsigned long height() const;
+ WEBCORE_EXPORT void setHeight(unsigned long);
+
+ WEBCORE_EXPORT unsigned long sampleCount() const;
+ WEBCORE_EXPORT void setSampleCount(unsigned long);
+
+ WEBCORE_EXPORT unsigned long textureType() const;
+ WEBCORE_EXPORT void setTextureType(unsigned long);
+
+ WEBCORE_EXPORT unsigned long storageMode() const;
+ WEBCORE_EXPORT void setStorageMode(unsigned long);
+
+ WEBCORE_EXPORT unsigned long usage() const;
+ WEBCORE_EXPORT void setUsage(unsigned long);
+
+#if PLATFORM(COCOA)
+ WEBCORE_EXPORT MTLTextureDescriptor* platformTextureDescriptor();
+#endif
+
+private:
+ GPUTextureDescriptor(unsigned long pixelFormat, unsigned long width, unsigned long height, bool mipmapped);
+
+#if PLATFORM(COCOA)
+ RetainPtr<MTLTextureDescriptor> m_textureDescriptor;
+#endif
+};
+
+} // namespace WebCore
+#endif
</ins></span></pre>
</div>
</div>
</body>
</html>