Title: [214105] trunk/Source/WebCore
Revision
214105
Author
[email protected]
Date
2017-03-17 07:11:24 -0700 (Fri, 17 Mar 2017)

Log Message

WebGPU: build fixes for non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=169781

Reviewed by Alex Christensen.

Enable building WebGPU code for other ports and fix various build
failures. This still leaves the GPUDevice::platformLayer() method
missing for other ports, as well as the general implementation of
the WebGPU platform abstractions under platform/graphics/gpu/.

* CMakeLists.txt: Move the WebGPU build targets here.
* PlatformMac.cmake:
* html/canvas/WebGPULibrary.h: Explicitly include the WTFString.h
header to suppress missing WTF::String definition errors.
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::contents): Avoid ambiguous calls to
ArrayBuffer::create() by passing nullptr as the first argument.
* platform/graphics/gpu/GPUDevice.h: Include the Forward.h header
to forward-declare the WTF::String class. Also remove the unused
PlatformGPUDevice typedef for non-Cocoa platforms.
(WebCore::GPUDevice::layer): Move this and the related m_layer
member variable under the PLATFORM(COCOA) guard.
* platform/graphics/gpu/GPUFunction.cpp:
(WebCore::GPUFunction::GPUFunction): Remove the GPULibrary
parameter checks in this no-op constructor that's used on
non-Cocoa platforms.

Modified Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (214104 => 214105)


--- trunk/Source/WebCore/CMakeLists.txt	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-03-17 14:11:24 UTC (rev 214105)
@@ -596,6 +596,25 @@
     html/canvas/CanvasProxy.idl
     html/canvas/CanvasRenderingContext2D.idl
     html/canvas/DOMPath.idl
+    html/canvas/WebGPUBuffer.idl
+    html/canvas/WebGPUCommandBuffer.idl
+    html/canvas/WebGPUCommandQueue.idl
+    html/canvas/WebGPUDepthStencilDescriptor.idl
+    html/canvas/WebGPUDepthStencilState.idl
+    html/canvas/WebGPUDrawable.idl
+    html/canvas/WebGPUFunction.idl
+    html/canvas/WebGPULibrary.idl
+    html/canvas/WebGPURenderCommandEncoder.idl
+    html/canvas/WebGPURenderPassAttachmentDescriptor.idl
+    html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl
+    html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl
+    html/canvas/WebGPURenderPassDescriptor.idl
+    html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl
+    html/canvas/WebGPURenderPipelineDescriptor.idl
+    html/canvas/WebGPURenderPipelineState.idl
+    html/canvas/WebGPURenderingContext.idl
+    html/canvas/WebGPUTexture.idl
+    html/canvas/WebGPUTextureDescriptor.idl
 
     inspector/CommandLineAPIHost.idl
     inspector/InspectorFrontendHost.idl
@@ -1210,6 +1229,8 @@
     bindings/js/JSWebGL2RenderingContextCustom.cpp
     bindings/js/JSWebGLRenderingContextBaseCustom.cpp
     bindings/js/JSWebGLRenderingContextCustom.cpp
+    bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp
+    bindings/js/JSWebGPURenderingContextCustom.cpp
     bindings/js/JSWebKitSubtleCryptoCustom.cpp
     bindings/js/JSWorkerCustom.cpp
     bindings/js/JSWorkerGlobalScopeBase.cpp
@@ -1798,6 +1819,27 @@
     html/canvas/CanvasRenderingContext2D.cpp
     html/canvas/CanvasStyle.cpp
     html/canvas/DOMPath.cpp
+    html/canvas/WebGPUBuffer.cpp
+    html/canvas/WebGPUCommandBuffer.cpp
+    html/canvas/WebGPUCommandQueue.cpp
+    html/canvas/WebGPUDepthStencilDescriptor.cpp
+    html/canvas/WebGPUDepthStencilState.cpp
+    html/canvas/WebGPUDrawable.cpp
+    html/canvas/WebGPUEnums.cpp
+    html/canvas/WebGPUFunction.cpp
+    html/canvas/WebGPULibrary.cpp
+    html/canvas/WebGPUObject.cpp
+    html/canvas/WebGPURenderCommandEncoder.cpp
+    html/canvas/WebGPURenderPassAttachmentDescriptor.cpp
+    html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp
+    html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp
+    html/canvas/WebGPURenderPassDescriptor.cpp
+    html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp
+    html/canvas/WebGPURenderPipelineDescriptor.cpp
+    html/canvas/WebGPURenderPipelineState.cpp
+    html/canvas/WebGPURenderingContext.cpp
+    html/canvas/WebGPUTexture.cpp
+    html/canvas/WebGPUTextureDescriptor.cpp
 
     html/forms/FileIconLoader.cpp
 
@@ -2291,6 +2333,26 @@
     platform/graphics/filters/SourceGraphic.cpp
     platform/graphics/filters/SpotLightSource.cpp
 
+    platform/graphics/gpu/GPUBuffer.cpp
+    platform/graphics/gpu/GPUCommandBuffer.cpp
+    platform/graphics/gpu/GPUCommandQueue.cpp
+    platform/graphics/gpu/GPUDepthStencilDescriptor.cpp
+    platform/graphics/gpu/GPUDepthStencilState.cpp
+    platform/graphics/gpu/GPUDevice.cpp
+    platform/graphics/gpu/GPUDrawable.cpp
+    platform/graphics/gpu/GPUFunction.cpp
+    platform/graphics/gpu/GPULibrary.cpp
+    platform/graphics/gpu/GPURenderCommandEncoder.cpp
+    platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp
+    platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp
+    platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp
+    platform/graphics/gpu/GPURenderPassDescriptor.cpp
+    platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp
+    platform/graphics/gpu/GPURenderPipelineDescriptor.cpp
+    platform/graphics/gpu/GPURenderPipelineState.cpp
+    platform/graphics/gpu/GPUTexture.cpp
+    platform/graphics/gpu/GPUTextureDescriptor.cpp
+
     platform/graphics/opentype/OpenTypeMathData.cpp
 
     platform/graphics/transforms/AffineTransform.cpp

Modified: trunk/Source/WebCore/ChangeLog (214104 => 214105)


--- trunk/Source/WebCore/ChangeLog	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/ChangeLog	2017-03-17 14:11:24 UTC (rev 214105)
@@ -1,3 +1,32 @@
+2017-03-17  Zan Dobersek  <[email protected]>
+
+        WebGPU: build fixes for non-Cocoa platforms
+        https://bugs.webkit.org/show_bug.cgi?id=169781
+
+        Reviewed by Alex Christensen.
+
+        Enable building WebGPU code for other ports and fix various build
+        failures. This still leaves the GPUDevice::platformLayer() method
+        missing for other ports, as well as the general implementation of
+        the WebGPU platform abstractions under platform/graphics/gpu/.
+
+        * CMakeLists.txt: Move the WebGPU build targets here.
+        * PlatformMac.cmake:
+        * html/canvas/WebGPULibrary.h: Explicitly include the WTFString.h
+        header to suppress missing WTF::String definition errors.
+        * platform/graphics/gpu/GPUBuffer.cpp:
+        (WebCore::GPUBuffer::contents): Avoid ambiguous calls to
+        ArrayBuffer::create() by passing nullptr as the first argument.
+        * platform/graphics/gpu/GPUDevice.h: Include the Forward.h header
+        to forward-declare the WTF::String class. Also remove the unused
+        PlatformGPUDevice typedef for non-Cocoa platforms.
+        (WebCore::GPUDevice::layer): Move this and the related m_layer
+        member variable under the PLATFORM(COCOA) guard.
+        * platform/graphics/gpu/GPUFunction.cpp:
+        (WebCore::GPUFunction::GPUFunction): Remove the GPULibrary
+        parameter checks in this no-op constructor that's used on
+        non-Cocoa platforms.
+
 2017-03-17  Miguel Gomez  <[email protected]>
 
         Follow-up (r213833): write a layout test for 169199

Modified: trunk/Source/WebCore/PlatformMac.cmake (214104 => 214105)


--- trunk/Source/WebCore/PlatformMac.cmake	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/PlatformMac.cmake	2017-03-17 14:11:24 UTC (rev 214105)
@@ -166,8 +166,6 @@
     accessibility/mac/WebAccessibilityObjectWrapperMac.mm
 
     bindings/js/ScriptControllerMac.mm
-    bindings/js/JSWebGPURenderingContextCustom.cpp
-    bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp
 
     bridge/objc/ObjCRuntimeObject.mm
     bridge/objc/WebScriptObject.mm
@@ -245,28 +243,6 @@
 
     html/HTMLSlotElement.cpp
 
-    html/canvas/WebGPUBuffer.cpp
-    html/canvas/WebGPUCommandBuffer.cpp
-    html/canvas/WebGPUCommandQueue.cpp
-    html/canvas/WebGPUDepthStencilDescriptor.cpp
-    html/canvas/WebGPUDepthStencilState.cpp
-    html/canvas/WebGPUDrawable.cpp
-    html/canvas/WebGPUEnums.cpp
-    html/canvas/WebGPUFunction.cpp
-    html/canvas/WebGPULibrary.cpp
-    html/canvas/WebGPUObject.cpp
-    html/canvas/WebGPURenderCommandEncoder.cpp
-    html/canvas/WebGPURenderingContext.cpp
-    html/canvas/WebGPURenderPassAttachmentDescriptor.cpp
-    html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp
-    html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp
-    html/canvas/WebGPURenderPassDescriptor.cpp
-    html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp
-    html/canvas/WebGPURenderPipelineDescriptor.cpp
-    html/canvas/WebGPURenderPipelineState.cpp
-    html/canvas/WebGPUTexture.cpp
-    html/canvas/WebGPUTextureDescriptor.cpp
-
     html/shadow/ImageControlsRootElement.cpp
     html/shadow/YouTubeEmbedShadowElement.cpp
 
@@ -481,25 +457,6 @@
     platform/graphics/cv/TextureCacheCV.mm
     platform/graphics/cv/VideoTextureCopierCV.cpp
 
-    platform/graphics/gpu/GPUBuffer.cpp
-    platform/graphics/gpu/GPUCommandBuffer.cpp
-    platform/graphics/gpu/GPUCommandQueue.cpp
-    platform/graphics/gpu/GPUDepthStencilDescriptor.cpp
-    platform/graphics/gpu/GPUDepthStencilState.cpp
-    platform/graphics/gpu/GPUDevice.cpp
-    platform/graphics/gpu/GPUDrawable.cpp
-    platform/graphics/gpu/GPUFunction.cpp
-    platform/graphics/gpu/GPULibrary.cpp
-    platform/graphics/gpu/GPURenderCommandEncoder.cpp
-    platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp
-    platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp
-    platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp
-    platform/graphics/gpu/GPURenderPassDescriptor.cpp
-    platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp
-    platform/graphics/gpu/GPURenderPipelineDescriptor.cpp
-    platform/graphics/gpu/GPURenderPipelineState.cpp
-    platform/graphics/gpu/GPUTexture.cpp
-    platform/graphics/gpu/GPUTextureDescriptor.cpp
     platform/graphics/gpu/Texture.cpp
     platform/graphics/gpu/TilingData.cpp
 
@@ -815,25 +772,6 @@
 
 list(APPEND WebCore_IDL_FILES
     Modules/plugins/QuickTimePluginReplacement.idl
-    html/canvas/WebGPUBuffer.idl
-    html/canvas/WebGPUCommandBuffer.idl
-    html/canvas/WebGPUCommandQueue.idl
-    html/canvas/WebGPUDepthStencilDescriptor.idl
-    html/canvas/WebGPUDepthStencilState.idl
-    html/canvas/WebGPUDrawable.idl
-    html/canvas/WebGPUFunction.idl
-    html/canvas/WebGPULibrary.idl
-    html/canvas/WebGPURenderCommandEncoder.idl
-    html/canvas/WebGPURenderingContext.idl
-    html/canvas/WebGPURenderPassAttachmentDescriptor.idl
-    html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl
-    html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl
-    html/canvas/WebGPURenderPassDescriptor.idl
-    html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl
-    html/canvas/WebGPURenderPipelineDescriptor.idl
-    html/canvas/WebGPURenderPipelineState.idl
-    html/canvas/WebGPUTexture.idl
-    html/canvas/WebGPUTextureDescriptor.idl
 )
 
 WEBKIT_CREATE_FORWARDING_HEADERS(WebCore DIRECTORIES ${WebCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebCore_FORWARDING_HEADERS_FILES})

Modified: trunk/Source/WebCore/html/canvas/WebGPULibrary.h (214104 => 214105)


--- trunk/Source/WebCore/html/canvas/WebGPULibrary.h	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/html/canvas/WebGPULibrary.h	2017-03-17 14:11:24 UTC (rev 214105)
@@ -30,6 +30,7 @@
 #include "WebGPUObject.h"
 
 #include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp (214104 => 214105)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUBuffer.cpp	2017-03-17 14:11:24 UTC (rev 214105)
@@ -55,7 +55,7 @@
     if (m_contents)
         return m_contents;
 
-    m_contents = ArrayBuffer::create(0, 1);
+    m_contents = ArrayBuffer::create(nullptr, 1);
     return m_contents;
 }
 #endif

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h (214104 => 214105)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUDevice.h	2017-03-17 14:11:24 UTC (rev 214105)
@@ -29,6 +29,7 @@
 
 #include "PlatformLayer.h"
 #include <runtime/ArrayBufferView.h>
+#include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 
 #if USE(CA)
@@ -41,7 +42,6 @@
 OBJC_CLASS WebGPULayer;
 #else
 class WebGPULayer;
-typedef void PlatformGPUDevice;
 #endif
 
 namespace WebCore {
@@ -61,12 +61,11 @@
     void reshape(int width, int height);
 
 #if PLATFORM(COCOA)
+    WebGPULayer* layer() { return m_layer.get(); }
     CALayer* platformLayer() const { return reinterpret_cast<CALayer*>(m_layer.get()); }
     WEBCORE_EXPORT id platformDevice();
 #endif
 
-    WebGPULayer* layer() { return m_layer.get(); }
-
     WEBCORE_EXPORT RefPtr<GPUCommandQueue> createCommandQueue();
     WEBCORE_EXPORT RefPtr<GPULibrary> createLibrary(const String& sourceCode);
     WEBCORE_EXPORT RefPtr<GPUBuffer> createBufferFromData(ArrayBufferView* data);
@@ -79,8 +78,8 @@
 private:
     GPUDevice();
 
+#if PLATFORM(COCOA)
     RetainPtr<WebGPULayer> m_layer;
-#if PLATFORM(COCOA)
     RetainPtr<id> m_device;
 #endif
 };

Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUFunction.cpp (214104 => 214105)


--- trunk/Source/WebCore/platform/graphics/gpu/GPUFunction.cpp	2017-03-17 13:13:02 UTC (rev 214104)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUFunction.cpp	2017-03-17 14:11:24 UTC (rev 214105)
@@ -49,12 +49,9 @@
 }
 
 #if !PLATFORM(COCOA)
-GPUFunction::GPUFunction(GPULibrary* library, const String& name)
+GPUFunction::GPUFunction(GPULibrary*, const String&)
 {
     LOG(WebGPU, "GPUFunction::GPUFunction()");
-
-    if (!library || !library->library())
-        return;
 }
 
 String GPUFunction::name() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to