Encapsulate uses of WKSI to setup a remote layer into a new RemoteLayerClient class
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2012 03:12:36 +0000 (03:12 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2012 03:12:36 +0000 (03:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79612

Reviewed by Anders Carlsson.

* Platform/mac/RemoteLayerClient.h:
* Platform/mac/RemoteLayerClient.mm:
(WebKit::RemoteLayerClient::create):
(WebKit::RemoteLayerClient::RemoteLayerClient):
(WebKit::RemoteLayerClient::~RemoteLayerClient):
(WebKit::RemoteLayerClient::clientID):
(WebKit::RemoteLayerClient::invalidate):
New class that encapsulates calls to WKSI WKCARemoteLayerClient*. For platforms
where the use of WKSI is not necessary, due to CARemoteLayerClient being available,
stop using WKSI.

* PluginProcess/PluginControllerProxy.cpp:
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::platformInitialize):
(WebKit::PluginControllerProxy::platformDestroy):
(WebKit::PluginControllerProxy::remoteLayerClientID):
(WebKit::PluginControllerProxy::platformGeometryDidChange):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/FullScreen/mac/WebFullScreenManagerMac.h:
* WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
(WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
(WebKit::WebFullScreenManagerMac::disposeOfLayerClient):
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
(LayerTreeHostCAMac):
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
(WebKit::LayerTreeHostCAMac::platformInitialize):
(WebKit::LayerTreeHostCAMac::invalidate):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Switch to using RemoteLayerClient.

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
Use CARemoteLayerServer directly if available.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108946 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/mac/RemoteLayerClient.h [new file with mode: 0644]
Source/WebKit2/Platform/mac/RemoteLayerClient.mm [new file with mode: 0644]
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginControllerProxy.h
Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
Source/WebKit2/UIProcess/mac/WebContextMac.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.h
Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm
Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index acfc2d0..233f4b2 100644 (file)
@@ -1,3 +1,49 @@
+2012-02-26  Sam Weinig  <sam@webkit.org>
+
+        Encapsulate uses of WKSI to setup a remote layer into a new RemoteLayerClient class
+        https://bugs.webkit.org/show_bug.cgi?id=79612
+
+        Reviewed by Anders Carlsson.
+
+        * Platform/mac/RemoteLayerClient.h: 
+        * Platform/mac/RemoteLayerClient.mm: 
+        (WebKit::RemoteLayerClient::create):
+        (WebKit::RemoteLayerClient::RemoteLayerClient):
+        (WebKit::RemoteLayerClient::~RemoteLayerClient):
+        (WebKit::RemoteLayerClient::clientID):
+        (WebKit::RemoteLayerClient::invalidate):
+        New class that encapsulates calls to WKSI WKCARemoteLayerClient*. For platforms
+        where the use of WKSI is not necessary, due to CARemoteLayerClient being available,
+        stop using WKSI.
+
+        * PluginProcess/PluginControllerProxy.cpp:
+        * PluginProcess/PluginControllerProxy.h:
+        * PluginProcess/mac/PluginControllerProxyMac.mm:
+        (WebKit::PluginControllerProxy::platformInitialize):
+        (WebKit::PluginControllerProxy::platformDestroy):
+        (WebKit::PluginControllerProxy::remoteLayerClientID):
+        (WebKit::PluginControllerProxy::platformGeometryDidChange):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h:
+        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
+        (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer):
+        (WebKit::WebFullScreenManagerMac::disposeOfLayerClient):
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
+        (LayerTreeHostCAMac):
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
+        (WebKit::LayerTreeHostCAMac::platformInitialize):
+        (WebKit::LayerTreeHostCAMac::invalidate):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+        Switch to using RemoteLayerClient.
+
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+        (WebKit::PluginProcessProxy::platformInitializePluginProcess):
+        Use CARemoteLayerServer directly if available.
+
 2012-02-25  Anders Carlsson  <andersca@apple.com>
 
         Address review feedback from Andreas Kling.
diff --git a/Source/WebKit2/Platform/mac/RemoteLayerClient.h b/Source/WebKit2/Platform/mac/RemoteLayerClient.h
new file mode 100644 (file)
index 0000000..a4bb4f6
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#ifndef RemoteLayerClient_h
+#define RemoteLayerClient_h
+
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/RetainPtr.h>
+
+OBJC_CLASS CALayer;
+
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+OBJC_CLASS CARemoteLayerClient;
+typedef CARemoteLayerClient *PlatformRemoteLayerClient;
+#else
+typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
+typedef WKCARemoteLayerClientRef PlatformRemoteLayerClient;
+#endif
+
+namespace WebKit {
+
+class RemoteLayerClient {
+    WTF_MAKE_NONCOPYABLE(RemoteLayerClient);
+public:
+    static PassOwnPtr<RemoteLayerClient> create(mach_port_t serverPort, CALayer *rootLayer);
+    ~RemoteLayerClient();
+
+    uint32_t clientID() const;
+    void invalidate();
+
+private:
+    RemoteLayerClient(mach_port_t serverPort, CALayer *rootLayer);
+
+    RetainPtr<PlatformRemoteLayerClient> m_platformClient;
+};
+
+} // namespace WebKit
+
+#endif // RemoteLayerClient_h
diff --git a/Source/WebKit2/Platform/mac/RemoteLayerClient.mm b/Source/WebKit2/Platform/mac/RemoteLayerClient.mm
new file mode 100644 (file)
index 0000000..2a246da
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2012 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.
+ */
+
+#import "config.h"
+#import "RemoteLayerClient.h"
+
+#import <wtf/PassOwnPtr.h>
+
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+#import <QuartzCore/CARemoteLayerClient.h>
+#else
+#import <WebKitSystemInterface.h>
+#endif
+
+namespace WebKit {
+
+PassOwnPtr<RemoteLayerClient> RemoteLayerClient::create(mach_port_t serverPort, CALayer *rootLayer)
+{
+    return adoptPtr(new RemoteLayerClient(serverPort, rootLayer));
+}
+
+RemoteLayerClient::RemoteLayerClient(mach_port_t serverPort, CALayer *rootLayer)
+{
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    m_platformClient = adoptNS([[CARemoteLayerClient alloc] initWithServerPort:serverPort]);
+    m_platformClient.get().layer = rootLayer;
+#else
+    m_platformClient = WKCARemoteLayerClientMakeWithServerPort(serverPort)
+    WKCARemoteLayerClientSetLayer(m_platformClient.get(), rootLayer);
+#endif
+}
+
+RemoteLayerClient::~RemoteLayerClient()
+{
+}
+
+uint32_t RemoteLayerClient::clientID() const
+{
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    return m_platformClient.get().clientId;
+#else
+    return WKCARemoteLayerClientGetClientId(m_platformClient.get());
+#endif
+}
+
+void RemoteLayerClient::invalidate()
+{
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    [m_platformClient.get() invalidate];
+#else
+    WKCARemoteLayerClientInvalidate(m_platformClient.get());
+#endif
+}
+
+} // namespace WebKit
index b548f81..427509b 100644 (file)
 #include <WebCore/NotImplemented.h>
 #include <wtf/text/WTFString.h>
 
+#if PLATFORM(MAC)
+#include "RemoteLayerClient.h"
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {
index c79211a..2e12464 100644 (file)
 #include <WebCore/RunLoop.h>
 #include <wtf/Noncopyable.h>
 
-#if PLATFORM(MAC)
-#include <wtf/RetainPtr.h>
-
-typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
-#endif
-
 namespace CoreIPC {
     class DataReference;
 }
 
 namespace WebKit {
 
+class RemoteLayerClient;
 class ShareableBitmap;
 class WebProcessConnection;
 struct PluginCreationParameters;
@@ -191,7 +186,7 @@ private:
     bool m_isComplexTextInputEnabled;
 
     // For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process.
-    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
+    OwnPtr<RemoteLayerClient> m_remoteLayerClient;
 #endif
 
     // The contents scale factor of this plug-in.
index 95feaa5..7bac66a 100644 (file)
@@ -30,7 +30,7 @@
 
 #import "PluginProcess.h"
 #import "PluginProxyMessages.h"
-#import "WebKitSystemInterface.h"
+#import "RemoteLayerClient.h"
 #import "WebProcessConnection.h"
 #import <QuartzCore/QuartzCore.h>
 
@@ -60,11 +60,7 @@ void PluginControllerProxy::platformInitialize()
         return;
 
     ASSERT(!m_remoteLayerClient);
-
-    m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(PluginProcess::shared().compositingRenderServerPort());
-    ASSERT(m_remoteLayerClient);
-
-    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), platformLayer);
+    m_remoteLayerClient = RemoteLayerClient::create(PluginProcess::shared().compositingRenderServerPort(), platformLayer);
 }
 
 void PluginControllerProxy::platformDestroy()
@@ -72,7 +68,7 @@ void PluginControllerProxy::platformDestroy()
     if (!m_remoteLayerClient)
         return;
 
-    WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get());
+    m_remoteLayerClient->invalidate();
     m_remoteLayerClient = nullptr;
 }
 
@@ -81,12 +77,12 @@ uint32_t PluginControllerProxy::remoteLayerClientID() const
     if (!m_remoteLayerClient)
         return 0;
 
-    return WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
+    return m_remoteLayerClient->clientID();
 }
 
 void PluginControllerProxy::platformGeometryDidChange()
 {
-    CALayer * pluginLayer = m_plugin->pluginLayer();
+    CALayer *pluginLayer = m_plugin->pluginLayer();
 
     // We don't want to animate to the new size so we disable actions for this transaction.
     [CATransaction begin];
index b072417..4e539be 100644 (file)
 #import <spawn.h>
 #import <wtf/text/CString.h>
 
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+#import <QuartzCore/CARemoteLayerServer.h>
+#endif
+
 @interface WKPlaceholderModalWindow : NSWindow 
 @end
 
@@ -116,7 +120,12 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa
 {
 #if USE(ACCELERATED_COMPOSITING) && HAVE(HOSTED_CORE_ANIMATION)
     parameters.parentProcessName = [[NSProcessInfo processInfo] processName];
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    mach_port_t renderServerPort = [[CARemoteLayerServer sharedServer] serverPort];
+#else
     mach_port_t renderServerPort = WKInitializeRenderServer();
+#endif
+
     if (renderServerPort != MACH_PORT_NULL)
         parameters.acceleratedCompositingPort = CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND);
 #endif
index 5270b73..85b8ae1 100644 (file)
 #import <WebCore/FileSystem.h>
 #import <sys/param.h>
 
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+#import <QuartzCore/CARemoteLayerServer.h>
+#endif
+
 using namespace WebCore;
 
 NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
@@ -93,7 +97,11 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 #endif
 
 #if USE(ACCELERATED_COMPOSITING) && HAVE(HOSTED_CORE_ANIMATION)
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+    mach_port_t renderServerPort = [[CARemoteLayerServer sharedServer] serverPort];
+#else
     mach_port_t renderServerPort = WKInitializeRenderServer();
+#endif
     if (renderServerPort != MACH_PORT_NULL)
         parameters.acceleratedCompositingPort = CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND);
 #endif
index a4f5e3a..7378731 100644 (file)
                BCDE093B13272496001259FB /* MainMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA31011E3921E00DB1371 /* MainMac.cpp */; };
                BCDE093D13272496001259FB /* PluginProcessShim.dylib in Copy Plug-in Process Shim */ = {isa = PBXBuildFile; fileRef = 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */; };
                BCDE0ABF13272708001259FB /* PluginProcess.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCDE094213272496001259FB /* PluginProcess.app */; };
+               BCE0937714FB128C001138D9 /* RemoteLayerClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCE0937514FB128B001138D9 /* RemoteLayerClient.mm */; };
+               BCE0937814FB128C001138D9 /* RemoteLayerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE0937614FB128B001138D9 /* RemoteLayerClient.h */; };
                BCE17B7D1381F1170012A641 /* WKPagePrivateMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE17B7B1381F1170012A641 /* WKPagePrivateMac.cpp */; };
                BCE17B7E1381F1170012A641 /* WKPagePrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE17B7C1381F1170012A641 /* WKPagePrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCE2315D122C30CA00D5C35A /* WebURLRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE2315B122C30CA00D5C35A /* WebURLRequest.h */; };
                BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextInjectedBundleClient.h; sourceTree = "<group>"; };
                BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextInjectedBundleClient.cpp; sourceTree = "<group>"; };
                BCDE094213272496001259FB /* PluginProcess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PluginProcess.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               BCE0937514FB128B001138D9 /* RemoteLayerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerClient.mm; sourceTree = "<group>"; };
+               BCE0937614FB128B001138D9 /* RemoteLayerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerClient.h; sourceTree = "<group>"; };
                BCE17B7B1381F1170012A641 /* WKPagePrivateMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WKPagePrivateMac.cpp; path = mac/WKPagePrivateMac.cpp; sourceTree = "<group>"; };
                BCE17B7C1381F1170012A641 /* WKPagePrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPagePrivateMac.h; path = mac/WKPagePrivateMac.h; sourceTree = "<group>"; };
                BCE2315B122C30CA00D5C35A /* WebURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURLRequest.h; sourceTree = "<group>"; };
                                C0E3AA481209E45000A49D01 /* ModuleMac.mm */,
                                1A24BF39120896A600FBB059 /* SharedMemoryMac.cpp */,
                                BC0092F6115837A300E0AE2A /* WorkQueueMac.cpp */,
+                               BCE0937514FB128B001138D9 /* RemoteLayerClient.mm */,
+                               BCE0937614FB128B001138D9 /* RemoteLayerClient.h */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */,
                                BC2E6E8E1141971500A63B1E /* WorkQueue.h in Headers */,
                                1AB42E8714BBBBB2004272F7 /* KeychainShimResponseMap.h in Headers */,
+                               BCE0937814FB128C001138D9 /* RemoteLayerClient.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
                                BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */,
                                BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */,
+                               BCE0937714FB128C001138D9 /* RemoteLayerClient.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 27e8aff..33cf3f3 100644 (file)
 
 #import "LayerTreeContext.h"
 #import "WebFullScreenManager.h"
-
 #import <WebCore/GraphicsLayer.h>
 #import <WebCore/IntRect.h>
 #import <wtf/RetainPtr.h>
 
-typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
 OBJC_CLASS WebFullScreenManagerAnimationListener;
 
 namespace WebKit {
 
+class RemoteLayerClient;
+
 class WebFullScreenManagerMac : public WebFullScreenManager {
 public:
     static PassRefPtr<WebFullScreenManagerMac> create(WebPage*);
@@ -59,7 +59,7 @@ private:
 
     OwnPtr<WebCore::GraphicsLayer> m_rootLayer;
     LayerTreeContext m_layerTreeContext;
-    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
+    OwnPtr<RemoteLayerClient> m_remoteLayerClient;
     RetainPtr<id> m_enterFullScreenListener;
     RetainPtr<id> m_exitFullScreenListener;
 };
index 0706007..36fa19d 100644 (file)
@@ -30,6 +30,7 @@
 #import "Connection.h"
 #import "LayerTreeContext.h"
 #import "MessageID.h"
+#import "RemoteLayerClient.h"
 #import "WebFullScreenManagerProxyMessages.h"
 #import "WebPage.h"
 #import "WebProcess.h"
@@ -153,9 +154,6 @@ void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* lay
         return;
 
     if (!m_rootLayer) {
-        mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
-        m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
-
         m_rootLayer = GraphicsLayer::create(NULL);
 #ifndef NDEBUG
         m_rootLayer->setName("Full screen root layer");
@@ -164,8 +162,10 @@ void WebFullScreenManagerMac::setRootFullScreenLayer(WebCore::GraphicsLayer* lay
         m_rootLayer->setSize(getFullScreenRect().size());
 
         [m_rootLayer->platformLayer() setGeometryFlipped:YES];
-        WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer->platformLayer());
-        m_layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
+
+        m_remoteLayerClient = RemoteLayerClient::create(WebProcess::shared().compositingRenderServerPort(), m_rootLayer->platformLayer());
+        m_layerTreeContext.contextID = m_remoteLayerClient->clientID();
+
         m_page->send(Messages::WebFullScreenManagerProxy::EnterAcceleratedCompositingMode(m_layerTreeContext));
     }
 
@@ -183,8 +183,8 @@ void WebFullScreenManagerMac::disposeOfLayerClient()
 {
     if (!m_remoteLayerClient)
         return;
-    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), 0);
-    WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get());
+    
+    m_remoteLayerClient->invalidate();
     m_remoteLayerClient = nullptr;
 }
 
index 153256b..5559bbd 100644 (file)
 #define LayerTreeHostCAMac_h
 
 #include "LayerTreeHostCA.h"
+#include "RemoteLayerClient.h"
 #include <WebCore/LayerFlushScheduler.h>
 #include <WebCore/LayerFlushSchedulerClient.h>
-#include <wtf/RetainPtr.h>
-
-typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
 
 namespace WebKit {
 
@@ -61,7 +59,7 @@ private:
     // LayerFlushSchedulerClient
     virtual bool flushLayers();
 
-    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
+    OwnPtr<RemoteLayerClient> m_remoteLayerClient;
     WebCore::LayerFlushScheduler m_layerFlushScheduler;
 };
 
index d45837f..78117eb 100644 (file)
@@ -29,7 +29,6 @@
 #import "WebProcess.h"
 #import <QuartzCore/CATransaction.h>
 #import <WebCore/GraphicsLayer.h>
-#import <WebKitSystemInterface.h>
 
 using namespace WebCore;
 
@@ -59,12 +58,8 @@ LayerTreeHostCAMac::~LayerTreeHostCAMac()
 
 void LayerTreeHostCAMac::platformInitialize(LayerTreeContext& layerTreeContext)
 {
-    mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
-    m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
-
-    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), rootLayer()->platformLayer());
-
-    layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
+    m_remoteLayerClient = RemoteLayerClient::create(WebProcess::shared().compositingRenderServerPort(), rootLayer()->platformLayer());
+    layerTreeContext.contextID = m_remoteLayerClient->clientID();
 }
 
 void LayerTreeHostCAMac::scheduleLayerFlush()
@@ -84,7 +79,7 @@ void LayerTreeHostCAMac::invalidate()
 {
     m_layerFlushScheduler.invalidate();
 
-    WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get());
+    m_remoteLayerClient->invalidate();
     m_remoteLayerClient = nullptr;
 
     LayerTreeHostCA::invalidate();
index 806ead9..d4dde50 100644 (file)
 OBJC_CLASS CALayer;
 OBJC_CLASS WKContentLayer;
 
-typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
-
 namespace WebKit {
 
+class RemoteLayerClient;
+
 class TiledCoreAnimationDrawingArea : public DrawingArea, private WebCore::LayerFlushSchedulerClient {
 public:
     static PassOwnPtr<TiledCoreAnimationDrawingArea> create(WebPage*, const WebPageCreationParameters&);
@@ -68,7 +68,7 @@ private:
     bool m_layerTreeStateIsFrozen;
     WebCore::LayerFlushScheduler m_layerFlushScheduler;
 
-    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
+    OwnPtr<RemoteLayerClient> m_remoteLayerClient;
     RetainPtr<CALayer> m_rootLayer;
     RetainPtr<CALayer> m_pendingRootCompositingLayer;
 };
index 26fca92..0791b2b 100644 (file)
@@ -29,6 +29,7 @@
 #import "DrawingAreaProxyMessages.h"
 #import "EventDispatcher.h"
 #import "LayerTreeContext.h"
+#import "RemoteLayerClient.h"
 #import "WebPage.h"
 #import "WebProcess.h"
 #import <QuartzCore/QuartzCore.h>
@@ -38,7 +39,6 @@
 #import <WebCore/Page.h>
 #import <WebCore/ScrollingCoordinator.h>
 #import <WebCore/Settings.h>
-#import <WebKitSystemInterface.h>
 
 @interface CATransaction (Details)
 + (void)synchronize;
@@ -76,12 +76,10 @@ TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage* webPage, c
     m_rootLayer.get().opaque = YES;
     m_rootLayer.get().geometryFlipped = YES;
 
-    mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
-    m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
-    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), m_rootLayer.get());
+    m_remoteLayerClient = RemoteLayerClient::create(WebProcess::shared().compositingRenderServerPort(), m_rootLayer.get());
 
     LayerTreeContext layerTreeContext;
-    layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
+    layerTreeContext.contextID = m_remoteLayerClient->clientID();
     m_webPage->send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(0, layerTreeContext));
 }