Title: [143803] trunk/Source
Revision
143803
Author
commit-qu...@webkit.org
Date
2013-02-22 14:42:58 -0800 (Fri, 22 Feb 2013)

Log Message

[chromium] Register newly-created layers for animation
https://bugs.webkit.org/show_bug.cgi?id=106594

Patch by Ali Juma <aj...@chromium.org> on 2013-02-22
Reviewed by James Robinson.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::registerForAnimations):

Source/WebKit/chromium:

* WebKit.gyp:
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::ChromeClientImpl):
(WebKit::ChromeClientImpl::graphicsLayerFactory):
* src/ChromeClientImpl.h:
(ChromeClientImpl):
* src/GraphicsLayerFactoryChromium.cpp: Added.
(WebKit):
(WebKit::GraphicsLayerFactoryChromium::GraphicsLayerFactoryChromium):
(WebKit::GraphicsLayerFactoryChromium::~GraphicsLayerFactoryChromium):
(WebKit::GraphicsLayerFactoryChromium::createGraphicsLayer):
* src/GraphicsLayerFactoryChromium.h: Added.
(WebKit):
(GraphicsLayerFactoryChromium):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::graphicsLayerFactory):
(WebKit):
(WebKit::WebViewImpl::registerForAnimations):
* src/WebViewImpl.h:
(WebViewImpl):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (143802 => 143803)


--- trunk/Source/Platform/ChangeLog	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/Platform/ChangeLog	2013-02-22 22:42:58 UTC (rev 143803)
@@ -1,3 +1,14 @@
+2013-02-22  Ali Juma  <aj...@chromium.org>
+
+        [chromium] Register newly-created layers for animation
+        https://bugs.webkit.org/show_bug.cgi?id=106594
+
+        Reviewed by James Robinson.
+
+        * chromium/public/WebLayerTreeView.h:
+        (WebLayerTreeView):
+        (WebKit::WebLayerTreeView::registerForAnimations):
+
 2013-02-22  Chris Rogers  <crog...@google.com>
 
         AudioDestination::create() needs extra device identification information for live/local input streams

Modified: trunk/Source/Platform/chromium/public/WebLayerTreeView.h (143802 => 143803)


--- trunk/Source/Platform/chromium/public/WebLayerTreeView.h	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/Platform/chromium/public/WebLayerTreeView.h	2013-02-22 22:42:58 UTC (rev 143803)
@@ -172,6 +172,10 @@
     // Prevents updates to layer tree from becoming visible.
     virtual void setDeferCommits(bool deferCommits) { }
 
+    // Take responsiblity for this layer's animations, even if this layer hasn't yet
+    // been added to the tree.
+    virtual void registerForAnimations(WebLayer* layer) { }
+
     // Debugging / dangerous ---------------------------------------------
 
     // Fills in a WebRenderingStats struct containing information about the state of the compositor.

Modified: trunk/Source/WebKit/chromium/ChangeLog (143802 => 143803)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-02-22 22:42:58 UTC (rev 143803)
@@ -1,3 +1,32 @@
+2013-02-22  Ali Juma  <aj...@chromium.org>
+
+        [chromium] Register newly-created layers for animation
+        https://bugs.webkit.org/show_bug.cgi?id=106594
+
+        Reviewed by James Robinson.
+
+        * WebKit.gyp:
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::ChromeClientImpl):
+        (WebKit::ChromeClientImpl::graphicsLayerFactory):
+        * src/ChromeClientImpl.h:
+        (ChromeClientImpl):
+        * src/GraphicsLayerFactoryChromium.cpp: Added.
+        (WebKit):
+        (WebKit::GraphicsLayerFactoryChromium::GraphicsLayerFactoryChromium):
+        (WebKit::GraphicsLayerFactoryChromium::~GraphicsLayerFactoryChromium):
+        (WebKit::GraphicsLayerFactoryChromium::createGraphicsLayer):
+        * src/GraphicsLayerFactoryChromium.h: Added.
+        (WebKit):
+        (GraphicsLayerFactoryChromium):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::graphicsLayerFactory):
+        (WebKit):
+        (WebKit::WebViewImpl::registerForAnimations):
+        * src/WebViewImpl.h:
+        (WebViewImpl):
+
 2013-02-22  Fady Samuel  <fsam...@chromium.org>
 
         [Chromium] Expose shadowRoot to the WebKit API

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (143802 => 143803)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2013-02-22 22:42:58 UTC (rev 143803)
@@ -350,6 +350,8 @@
                 'src/FrameNetworkingContextImpl.h',
                 'src/GeolocationClientProxy.cpp',
                 'src/GeolocationClientProxy.h',
+                'src/GraphicsLayerFactoryChromium.cpp',
+                'src/GraphicsLayerFactoryChromium.h',
                 'src/gtk/WebInputEventFactory.cpp',
                 'src/WebHelperPluginImpl.cpp',
                 'src/WebHelperPluginImpl.h',

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (143802 => 143803)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2013-02-22 22:42:58 UTC (rev 143803)
@@ -58,7 +58,6 @@
 #include "FrameView.h"
 #include "Geolocation.h"
 #include "GraphicsLayerChromium.h"
-#include "GraphicsLayerFactory.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HitTestResult.h"
@@ -113,20 +112,6 @@
 
 using namespace WebCore;
 
-namespace {
-
-class GraphicsLayerFactoryChromium : public GraphicsLayerFactory {
-public:
-    virtual ~GraphicsLayerFactoryChromium() { }
-
-    virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient* client) OVERRIDE
-    {
-        return adoptPtr(new GraphicsLayerChromium(client));
-    }
-};
-
-} // namespace
-
 namespace WebKit {
 
 // Converts a WebCore::PopupContainerType to a WebKit::WebPopupType.
@@ -161,9 +146,6 @@
 #if ENABLE(PAGE_POPUP)
     , m_pagePopupDriver(webView)
 #endif
-#if USE(ACCELERATED_COMPOSITING)
-    , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium))
-#endif
 {
 }
 
@@ -935,7 +917,7 @@
 #if USE(ACCELERATED_COMPOSITING)
 GraphicsLayerFactory* ChromeClientImpl::graphicsLayerFactory() const
 {
-    return m_graphicsLayerFactory.get();
+    return m_webView->graphicsLayerFactory();
 }
 
 void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.h (143802 => 143803)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.h	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.h	2013-02-22 22:42:58 UTC (rev 143803)
@@ -38,7 +38,6 @@
 #include "SearchPopupMenu.h"
 #include "WebNavigationPolicy.h"
 #include <public/WebColor.h>
-#include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
@@ -252,10 +251,6 @@
 #if ENABLE(PAGE_POPUP)
     WebCore::PagePopupDriver* m_pagePopupDriver;
 #endif
-
-#if USE(ACCELERATED_COMPOSITING)
-    OwnPtr<WebCore::GraphicsLayerFactory> m_graphicsLayerFactory;
-#endif
 };
 
 class NavigatorContentUtilsClientImpl : public WebCore::NavigatorContentUtilsClient {

Added: trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.cpp (0 => 143803)


--- trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.cpp	                        (rev 0)
+++ trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.cpp	2013-02-22 22:42:58 UTC (rev 143803)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Google 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 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 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 "GraphicsLayerFactoryChromium.h"
+
+#include "GraphicsLayerChromium.h"
+#include "WebViewImpl.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+GraphicsLayerFactoryChromium::GraphicsLayerFactoryChromium(WebViewImpl* webView)
+    : m_webView(webView)
+{
+}
+
+GraphicsLayerFactoryChromium::~GraphicsLayerFactoryChromium()
+{
+}
+
+PassOwnPtr<GraphicsLayer> GraphicsLayerFactoryChromium::createGraphicsLayer(GraphicsLayerClient* client)
+{
+    OwnPtr<GraphicsLayerChromium> layer = adoptPtr(new GraphicsLayerChromium(client));
+    m_webView->registerForAnimations(layer->platformLayer());
+    return layer.release();
+}
+
+} // namespace WebKit

Added: trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.h (0 => 143803)


--- trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.h	                        (rev 0)
+++ trunk/Source/WebKit/chromium/src/GraphicsLayerFactoryChromium.h	2013-02-22 22:42:58 UTC (rev 143803)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Google 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 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 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 GraphicsLayerFactoryChromium_h
+#define GraphicsLayerFactoryChromium_h
+
+#include "GraphicsLayerFactory.h"
+
+namespace WebKit {
+class WebViewImpl;
+
+class GraphicsLayerFactoryChromium : public WebCore::GraphicsLayerFactory {
+public:
+    explicit GraphicsLayerFactoryChromium(WebViewImpl*);
+
+    virtual ~GraphicsLayerFactoryChromium();
+
+    virtual PassOwnPtr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient*) OVERRIDE;
+
+private:
+    // The owner of this GraphicsLayerFactoryChromium.
+    WebViewImpl* m_webView;
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (143802 => 143803)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-02-22 22:42:58 UTC (rev 143803)
@@ -68,6 +68,7 @@
 #include "GraphicsContext.h"
 #include "GraphicsContext3D.h"
 #include "GraphicsContext3DPrivate.h"
+#include "GraphicsLayerFactoryChromium.h"
 #include "HTMLInputElement.h"
 #include "HTMLMediaElement.h"
 #include "HTMLNames.h"
@@ -424,6 +425,7 @@
     , m_layerTreeView(0)
     , m_rootLayer(0)
     , m_rootGraphicsLayer(0)
+    , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this)))
     , m_isAcceleratedCompositingActive(false)
     , m_layerTreeViewCommitsDeferred(false)
     , m_compositorCreationFailed(false)
@@ -4087,9 +4089,15 @@
 
 WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const
 {
-    return m_chromeClientImpl.graphicsLayerFactory();
+    return m_graphicsLayerFactory.get();
 }
 
+void WebViewImpl::registerForAnimations(WebLayer* layer)
+{
+    if (m_layerTreeView)
+        m_layerTreeView->registerForAnimations(layer);
+}
+
 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer()
 {
     return m_rootGraphicsLayer;

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (143802 => 143803)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-02-22 22:39:26 UTC (rev 143802)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-02-22 22:42:58 UTC (rev 143803)
@@ -548,6 +548,7 @@
     NonCompositedContentHost* nonCompositedContentHost();
     void setBackgroundColor(const WebCore::Color&);
     WebCore::GraphicsLayerFactory* graphicsLayerFactory() const;
+    void registerForAnimations(WebLayer*);
 #endif
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     void scheduleAnimation();
@@ -863,6 +864,7 @@
     WebLayerTreeView* m_layerTreeView;
     WebLayer* m_rootLayer;
     WebCore::GraphicsLayer* m_rootGraphicsLayer;
+    OwnPtr<WebCore::GraphicsLayerFactory> m_graphicsLayerFactory;
     bool m_isAcceleratedCompositingActive;
     bool m_layerTreeViewCommitsDeferred;
     bool m_compositorCreationFailed;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to