Diff
Modified: trunk/Source/WebCore/ChangeLog (213785 => 213786)
--- trunk/Source/WebCore/ChangeLog 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebCore/ChangeLog 2017-03-13 07:54:43 UTC (rev 213786)
@@ -1,3 +1,22 @@
+2017-03-13 Dean Jackson <[email protected]>
+
+ WebGPU remote layer hosting
+ https://bugs.webkit.org/show_bug.cgi?id=169539
+ <rdar://problem/31005380>
+
+ Reviewed by Jon Lee.
+
+ Implement the WebProcess side of WebGPULayer hosting,
+ via LayerTypeWebGPULayer.
+
+ * platform/graphics/ca/PlatformCALayer.cpp:
+ (WebCore::operator<<): Provide nice pretty printing.
+ * platform/graphics/ca/PlatformCALayer.h: Add LayerTypeWebGPULayer.
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Support LayerTypeWebGPULayer.
+ (PlatformCALayerCocoa::layerTypeForPlatformLayer):
+ (PlatformCALayerCocoa::PlatformCALayerCocoa):
+ (PlatformCALayerCocoa::commonInit):
+
2017-03-13 Zan Dobersek <[email protected]>
Unreviewed GTK+ build fix. Adjust the Cookie constructor
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (213785 => 213786)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp 2017-03-13 07:54:43 UTC (rev 213786)
@@ -226,6 +226,11 @@
case PlatformCALayer::LayerTypeWebGLLayer:
ts << "web-gl-layer";
break;
+#if ENABLE(WEBGPU)
+ case PlatformCALayer::LayerTypeWebGPULayer:
+ ts << "webgpu-layer";
+ break;
+#endif
case PlatformCALayer::LayerTypeShapeLayer:
ts << "shape-layer";
break;
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (213785 => 213786)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2017-03-13 07:54:43 UTC (rev 213786)
@@ -73,6 +73,9 @@
LayerTypeRootLayer,
LayerTypeAVPlayerLayer,
LayerTypeWebGLLayer,
+#if ENABLE(WEBGPU)
+ LayerTypeWebGPULayer,
+#endif
LayerTypeBackdropLayer,
LayerTypeShapeLayer,
LayerTypeLightSystemBackdropLayer,
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (213785 => 213786)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -40,6 +40,9 @@
#import "WebActionDisablingCALayerDelegate.h"
#import "WebCoreCALayerExtras.h"
#import "WebGLLayer.h"
+#if ENABLE(WEBGPU)
+#import "WebGPULayer.h"
+#endif
#import "WebLayer.h"
#import "WebSystemBackdropLayer.h"
#import "WebTiledBackingLayer.h"
@@ -195,6 +198,11 @@
if ([layer isKindOfClass:[WebGLLayer class]])
return LayerTypeWebGLLayer;
+#if ENABLE(WEBGPU)
+ if ([layer isKindOfClass:[WebGPULayer class]])
+ return LayerTypeWebGPULayer;
+#endif
+
return LayerTypeCustom;
}
@@ -246,6 +254,9 @@
case LayerTypeAVPlayerLayer:
layerClass = getAVPlayerLayerClass();
break;
+#if ENABLE(WEBGPU)
+ case LayerTypeWebGPULayer:
+#endif
case LayerTypeWebGLLayer:
// We don't create PlatformCALayerCocoas wrapped around WebGLLayers.
ASSERT_NOT_REACHED();
@@ -284,7 +295,11 @@
[m_layer setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
// Clear all the implicit animations on the CALayer
+#if ENABLE(WEBGPU)
+ if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeWebGPULayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom)
+#else
if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom)
+#endif
[m_layer web_disableAllActions];
else
[m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
Modified: trunk/Source/WebKit2/ChangeLog (213785 => 213786)
--- trunk/Source/WebKit2/ChangeLog 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/ChangeLog 2017-03-13 07:54:43 UTC (rev 213786)
@@ -1,3 +1,25 @@
+2017-03-13 Dean Jackson <[email protected]>
+
+ WebGPU remote layer hosting
+ https://bugs.webkit.org/show_bug.cgi?id=169539
+ <rdar://problem/31005380>
+
+ Reviewed by Jon Lee.
+
+ Implement the host-side part of WebGPULayer.
+
+ * Shared/mac/RemoteLayerBackingStore.mm: Add support for LayerTypeWebGPULayer.
+ (WebKit::RemoteLayerBackingStore::drawInContext):
+ * Shared/mac/RemoteLayerTreeTransaction.mm: Ditto.
+ (WebKit::RemoteLayerTreeTransaction::description):
+ * UIProcess/ios/RemoteLayerTreeHostIOS.mm: Ditto.
+ (WebKit::RemoteLayerTreeHost::createLayer):
+ * UIProcess/mac/RemoteLayerTreeHost.mm: Ditto.
+ (WebKit::RemoteLayerTreeHost::createLayer):
+ * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Ditto.
+ (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
+ (WebKit::PlatformCALayerRemoteCustom::clone):
+
2017-03-13 Zan Dobersek <[email protected]>
Unreviewed GTK+ build fix. Use WTF::Function<> for the
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (213785 => 213786)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -359,6 +359,9 @@
case PlatformCALayer::LayerTypeRootLayer:
case PlatformCALayer::LayerTypeAVPlayerLayer:
case PlatformCALayer::LayerTypeWebGLLayer:
+#if ENABLE(WEBGPU)
+ case PlatformCALayer::LayerTypeWebGPULayer:
+#endif
case PlatformCALayer::LayerTypeShapeLayer:
case PlatformCALayer::LayerTypeScrollingLayer:
case PlatformCALayer::LayerTypeCustom:
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (213785 => 213786)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -893,6 +893,11 @@
case PlatformCALayer::LayerTypeAVPlayerLayer:
ts << " (context-id " << createdLayer.hostingContextID << ")";
break;
+#if ENABLE(WEBGPU)
+ case PlatformCALayer::LayerTypeWebGPULayer:
+ ts << " (context-id " << createdLayer.hostingContextID << ")";
+ break;
+#endif
case PlatformCALayer::LayerTypeWebGLLayer:
ts << " (context-id " << createdLayer.hostingContextID << ")";
break;
Modified: trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm (213785 => 213786)
--- trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -206,6 +206,9 @@
break;
case PlatformCALayer::LayerTypeCustom:
case PlatformCALayer::LayerTypeAVPlayerLayer:
+#if ENABLE(WEBGPU)
+ case PlatformCALayer::LayerTypeWebGPULayer:
+#endif
case PlatformCALayer::LayerTypeWebGLLayer:
if (!m_isDebugLayerTreeHost) {
view = adoptNS([[WKRemoteView alloc] initWithFrame:CGRectZero contextID:properties.hostingContextID]);
Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (213785 => 213786)
--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -254,6 +254,9 @@
break;
case PlatformCALayer::LayerTypeCustom:
case PlatformCALayer::LayerTypeAVPlayerLayer:
+#if ENABLE(WEBGPU)
+ case PlatformCALayer::LayerTypeWebGPULayer:
+#endif
case PlatformCALayer::LayerTypeWebGLLayer:
if (!m_isDebugLayerTreeHost)
layer = WKMakeRenderLayer(properties.hostingContextID);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm (213785 => 213786)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm 2017-03-13 07:33:22 UTC (rev 213785)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm 2017-03-13 07:54:43 UTC (rev 213786)
@@ -82,7 +82,11 @@
m_platformLayer = customLayer;
[customLayer web_disableAllActions];
+#if ENABLE(WEBGPU)
+ m_providesContents = layerType == LayerTypeWebGLLayer || layerType == LayerTypeWebGPULayer;
+#else
m_providesContents = layerType == LayerTypeWebGLLayer;
+#endif
properties().position = FloatPoint3D(customLayer.position.x, customLayer.position.y, customLayer.zPosition);
properties().anchorPoint = FloatPoint3D(customLayer.anchorPoint.x, customLayer.anchorPoint.y, customLayer.anchorPointZ);
@@ -121,7 +125,11 @@
}
copyContents = false;
+#if ENABLE(WEBGPU)
+ } else if (layerType() == LayerTypeWebGLLayer || layerType() == LayerTypeWebGPULayer) {
+#else
} else if (layerType() == LayerTypeWebGLLayer) {
+#endif
clonedLayer = adoptNS([[CALayer alloc] init]);
// FIXME: currently copying WebGL contents breaks the original layer.
copyContents = false;