[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

andersca at apple.com andersca at apple.com
Mon Feb 21 00:34:35 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit f39674283000a208a7de7062db18dced15ae46bc
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 1 22:51:45 2011 +0000

    2011-02-01  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Adam Roben.
    
            Send messages when entering/exiting accelerated compositing
            https://bugs.webkit.org/show_bug.cgi?id=53534
    
            * Shared/LayerTreeContext.h: Added.
            * Shared/mac/LayerTreeContextMac.mm: Added.
            Add new LayerTreeContext which holds all information needed to enter
            accelerated compositing mode.
    
            * UIProcess/DrawingAreaProxy.h:
            (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
            (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
            Add empty stubs.
    
            * UIProcess/DrawingAreaProxy.messages.in:
            Add new messgaes.
    
            * UIProcess/DrawingAreaProxyImpl.cpp:
            (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
            (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
            * UIProcess/DrawingAreaProxyImpl.h:
            Add empty stubs.
    
            * WebKit2.xcodeproj/project.pbxproj:
            Add new files.
    
            * WebProcess/WebPage/mac/LayerTreeHostMac.h:
            * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
            (WebKit::LayerTreeHostMac::LayerTreeHostMac):
            (WebKit::LayerTreeHostMac::invalidate):
            Send messages.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index f73fbdd..d54d600 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,38 @@
+2011-02-01  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Send messages when entering/exiting accelerated compositing
+        https://bugs.webkit.org/show_bug.cgi?id=53534
+
+        * Shared/LayerTreeContext.h: Added.
+        * Shared/mac/LayerTreeContextMac.mm: Added.
+        Add new LayerTreeContext which holds all information needed to enter
+        accelerated compositing mode.
+
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::enterAcceleratedCompositingMode):
+        (WebKit::DrawingAreaProxy::exitAcceleratedCompositingMode):
+        Add empty stubs.
+
+        * UIProcess/DrawingAreaProxy.messages.in:
+        Add new messgaes.
+
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
+        (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
+        * UIProcess/DrawingAreaProxyImpl.h:
+        Add empty stubs.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add new files.
+
+        * WebProcess/WebPage/mac/LayerTreeHostMac.h:
+        * WebProcess/WebPage/mac/LayerTreeHostMac.mm:
+        (WebKit::LayerTreeHostMac::LayerTreeHostMac):
+        (WebKit::LayerTreeHostMac::invalidate):
+        Send messages.
+
 2011-02-01  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Dan Bernstein and Darin Adler.
diff --git a/Source/WebKit2/Shared/LayerTreeContext.h b/Source/WebKit2/Shared/LayerTreeContext.h
new file mode 100644
index 0000000..dab04f3
--- /dev/null
+++ b/Source/WebKit2/Shared/LayerTreeContext.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011 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 LayerTreeContext_h
+#define LayerTreeContext_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+class LayerTreeContext {
+public:
+    LayerTreeContext();
+    ~LayerTreeContext();
+
+    void encode(CoreIPC::ArgumentEncoder*) const;
+    static bool decode(CoreIPC::ArgumentDecoder*, LayerTreeContext&);
+
+    bool isEmpty() const;
+
+#if PLATFORM(MAC)
+    uint32_t contextID;
+#endif
+};
+
+};
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // LayerTreeContext_h
diff --git a/Source/WebKit2/Shared/mac/LayerTreeContextMac.mm b/Source/WebKit2/Shared/mac/LayerTreeContextMac.mm
new file mode 100644
index 0000000..8a9677e
--- /dev/null
+++ b/Source/WebKit2/Shared/mac/LayerTreeContextMac.mm
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#include "config.h"
+#include "LayerTreeContext.h"
+
+#include "ArgumentDecoder.h"
+#include "ArgumentEncoder.h"
+
+namespace WebKit {
+
+LayerTreeContext::LayerTreeContext()
+    : contextID(0)
+{
+}
+
+LayerTreeContext::~LayerTreeContext()
+{
+}
+
+void LayerTreeContext::encode(CoreIPC::ArgumentEncoder* encoder) const
+{
+    encoder->encode(contextID);
+}
+
+bool LayerTreeContext::decode(CoreIPC::ArgumentDecoder* decoder, LayerTreeContext& result)
+{
+    return decoder->decode(result.contextID);
+}
+
+bool LayerTreeContext::isEmpty() const
+{
+    return !contextID;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index c0bb71b..ce2c8fb 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -35,6 +35,10 @@ class QPainter;
 
 namespace WebKit {
 
+#if USE(ACCELERATED_COMPOSITING)
+class LayerTreeContext;
+#endif
+
 class UpdateInfo;
 class WebPageProxy;
 
@@ -94,6 +98,10 @@ private:
     // FIXME: These should be pure virtual.
     virtual void update(const UpdateInfo&) { }
     virtual void didSetSize(const UpdateInfo&) { }
+#if USE(ACCELERATED_COMPOSITING)
+    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) { }
+    virtual void exitAcceleratedCompositingMode() { }
+#endif
 };
 
 } // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in b/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
index ec065c7..029f08f 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
@@ -23,4 +23,9 @@
 messages -> DrawingAreaProxy {
     Update(WebKit::UpdateInfo updateInfo)
     DidSetSize(WebKit::UpdateInfo updateInfo)
+
+#if USE(ACCELERATED_COMPOSITING)
+    EnterAcceleratedCompositingMode(WebKit::LayerTreeContext context)
+    ExitAcceleratedCompositingMode()
+#endif
 }
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 6d7ae20..902f6ce 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -28,6 +28,7 @@
 
 #include "DrawingAreaMessages.h"
 #include "DrawingAreaProxyMessages.h"
+#include "LayerTreeContext.h"
 #include "Region.h"
 #include "UpdateInfo.h"
 #include "WebPageProxy.h"
@@ -146,6 +147,16 @@ void DrawingAreaProxyImpl::didSetSize(const UpdateInfo& updateInfo)
     incorporateUpdate(updateInfo);
 }
 
+void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContext& context)
+{
+    // FIXME: Implement.
+}
+
+void DrawingAreaProxyImpl::exitAcceleratedCompositingMode()
+{
+    // FIXME: Implement.
+}
+
 void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
 {
     if (updateInfo.updateRectBounds.isEmpty())
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index bf7b878..870a20b 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -56,7 +56,9 @@ private:
     // CoreIPC message handlers
     virtual void update(const UpdateInfo&);
     virtual void didSetSize(const UpdateInfo&);
-    
+    virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
+    virtual void exitAcceleratedCompositingMode();
+
     void incorporateUpdate(const UpdateInfo&);
     void sendSetSize();
 
diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
index a0fd9f3..8c7c088 100644
--- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -175,6 +175,8 @@
 		1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
 		1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */; };
 		1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
+		1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
+		1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */; };
 		1A9636BC12F348490078A062 /* ShareableSurface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9636BA12F348490078A062 /* ShareableSurface.cpp */; };
 		1A9636BD12F348490078A062 /* ShareableSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9636BB12F348490078A062 /* ShareableSurface.h */; };
 		1A9639F712F38ECD0078A062 /* CoreAnimationRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9639F512F38ECD0078A062 /* CoreAnimationRenderer.h */; };
@@ -924,6 +926,8 @@
 		1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = "<group>"; };
 		1A9101081268C8CA001842F5 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = "<group>"; };
 		1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = "<group>"; };
+		1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = "<group>"; };
+		1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeContextMac.mm; sourceTree = "<group>"; };
 		1A9636BA12F348490078A062 /* ShareableSurface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableSurface.cpp; sourceTree = "<group>"; };
 		1A9636BB12F348490078A062 /* ShareableSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareableSurface.h; sourceTree = "<group>"; };
 		1A9639F512F38ECD0078A062 /* CoreAnimationRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimationRenderer.h; sourceTree = "<group>"; };
@@ -1791,6 +1795,7 @@
 				BC64696E11DBE603006455B0 /* ImmutableArray.h */,
 				BCBCB0CC1215E33A00DE59CA /* ImmutableDictionary.cpp */,
 				BCBCB0CA1215E32100DE59CA /* ImmutableDictionary.h */,
+				1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */,
 				BCC8049D122F0D6B00103529 /* MutableArray.cpp */,
 				BCC8049E122F0D6B00103529 /* MutableArray.h */,
 				BCB0AEE8122F53E300B1341E /* MutableDictionary.cpp */,
@@ -2367,6 +2372,7 @@
 				1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */,
 				1A9639F512F38ECD0078A062 /* CoreAnimationRenderer.h */,
 				1A9639F612F38ECD0078A062 /* CoreAnimationRenderer.mm */,
+				1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */,
 				C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */,
 				C574A57F12E66681002DFE98 /* PasteboardTypes.h */,
 				C574A58012E66681002DFE98 /* PasteboardTypes.mm */,
@@ -3119,6 +3125,7 @@
 				1A9636BD12F348490078A062 /* ShareableSurface.h in Headers */,
 				1A9639F712F38ECD0078A062 /* CoreAnimationRenderer.h in Headers */,
 				1A690D1712F39E3300ECD289 /* LayerTreeHostMac.h in Headers */,
+				1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3588,6 +3595,7 @@
 				6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
 				1A9636BC12F348490078A062 /* ShareableSurface.cpp in Sources */,
 				1A9639F812F38ECD0078A062 /* CoreAnimationRenderer.mm in Sources */,
+				1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h b/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h
index 4e5ecba..d14e5f8 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.h
@@ -29,6 +29,8 @@
 #include "LayerTreeHost.h"
 #include <wtf/RetainPtr.h>
 
+typedef struct __WKCARemoteLayerClientRef* WKCARemoteLayerClientRef;
+
 namespace WebKit {
 
 class LayerTreeHostMac : public LayerTreeHost {
@@ -48,6 +50,8 @@ private:
     bool flushPendingLayerChanges();
 
     bool m_isValid;
+
+    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
     RetainPtr<CFRunLoopObserverRef> m_flushPendingLayerChangesRunLoopObserver;
 };
 
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm
index 47093a9..d08c462 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/LayerTreeHostMac.mm
@@ -26,10 +26,14 @@
 #import "config.h"
 #import "LayerTreeHostMac.h"
 
+#import "DrawingAreaProxyMessages.h"
+#import "LayerTreeContext.h"
+#import "WebPage.h"
+#import "WebProcess.h"
 #import <WebCore/Frame.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/Page.h>
-#import "WebPage.h"
+#import <WebKitSystemInterface.h>
 
 using namespace WebCore;
 
@@ -44,12 +48,27 @@ LayerTreeHostMac::LayerTreeHostMac(WebPage* webPage, GraphicsLayer* graphicsLaye
     : LayerTreeHost(webPage)
     , m_isValid(true)
 {
+    mach_port_t serverPort = WebProcess::shared().compositingRenderServerPort();
+
+    m_remoteLayerClient = WKCARemoteLayerClientMakeWithServerPort(serverPort);
+
+    // FIXME: Create a real layer instead of just a placeholder.
+    CALayer *layer = [CALayer layer];
+
+    WKCARemoteLayerClientSetLayer(m_remoteLayerClient.get(), layer);
+
+    LayerTreeContext layerTreeContext;
+    layerTreeContext.contextID = WKCARemoteLayerClientGetClientId(m_remoteLayerClient.get());
+
+    // FIXME: Don't send this if we enter accelerated compositing as a result of setSize.
+    m_webPage->send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(layerTreeContext));
 }
 
 LayerTreeHostMac::~LayerTreeHostMac()
 {
     ASSERT(!m_isValid);
     ASSERT(!m_flushPendingLayerChangesRunLoopObserver);
+    ASSERT(!m_remoteLayerClient);
 }
 
 void LayerTreeHostMac::scheduleLayerFlush()
@@ -79,7 +98,13 @@ void LayerTreeHostMac::invalidate()
         m_flushPendingLayerChangesRunLoopObserver = nullptr;
     }
 
+    WKCARemoteLayerClientInvalidate(m_remoteLayerClient.get());
+    m_remoteLayerClient = nullptr;
+
     m_isValid = false;
+
+    // FIXME: Don't send this if we enter accelerated compositing as a result of setSize.
+    m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode());
 }
 
 void LayerTreeHostMac::flushPendingLayerChangesRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list