Title: [90850] trunk/Source
Revision
90850
Author
[email protected]
Date
2011-07-12 14:22:45 -0700 (Tue, 12 Jul 2011)

Log Message

Move call to syncCompositingLayers so that we do not trigger redundant draws.
https://bugs.webkit.org/show_bug.cgi?id=64224

Source/WebCore:

doComposite was triggering two composites every time a canvas was dirtied.
By moving syncCompositingLayers call to layout, the client code can draw without triggering
a redundant frame. Also renamed WebViewImpl::updateLayers to
syncCompositingLayers, because it was confusing. CCLayerTreeHostImplProxy::updateLayers was
no longer needed, because animateAndLayout calls WebViewImpl::layout.

Patch by John Bates <[email protected]> on 2011-07-12
Reviewed by James Robinson.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::updateLayers):
* platform/graphics/chromium/LayerRendererChromium.h:
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::syncCompositingLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
* platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp:
(WebCore::CCLayerTreeHostImplProxy::requestFrameAndCommit):

Source/WebKit/chromium:

doComposite was triggering two composites every time a canvas was dirtied.
By moving syncCompositingLayers call to layout, the client code can draw without triggering
a redundant frame. Also renamed WebViewImpl::updateLayers to
syncCompositingLayers, because it was confusing.

Patch by John Bates <[email protected]> on 2011-07-12
Reviewed by James Robinson.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::layout):
(WebKit::WebViewImpl::syncCompositingLayers):
* src/WebViewImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (90849 => 90850)


--- trunk/Source/WebCore/ChangeLog	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/ChangeLog	2011-07-12 21:22:45 UTC (rev 90850)
@@ -1,3 +1,25 @@
+2011-07-12  John Bates  <[email protected]>
+
+        Move call to syncCompositingLayers so that we do not trigger redundant draws.
+        https://bugs.webkit.org/show_bug.cgi?id=64224
+
+        doComposite was triggering two composites every time a canvas was dirtied.
+        By moving syncCompositingLayers call to layout, the client code can draw without triggering
+        a redundant frame. Also renamed WebViewImpl::updateLayers to
+        syncCompositingLayers, because it was confusing. CCLayerTreeHostImplProxy::updateLayers was
+        no longer needed, because animateAndLayout calls WebViewImpl::layout.
+
+        Reviewed by James Robinson.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::updateLayers):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::syncCompositingLayers):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp:
+        (WebCore::CCLayerTreeHostImplProxy::requestFrameAndCommit):
+
 2011-07-12  Ryosuke Niwa  <[email protected]>
 
         Isolate HTMLTextFormControlElement into a separate file

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (90849 => 90850)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-07-12 21:22:45 UTC (rev 90850)
@@ -249,7 +249,6 @@
 
 void LayerRendererChromium::updateLayers()
 {
-    CCLayerTreeHost::updateLayers();
     if (m_viewportVisibleRect.isEmpty())
         return;
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (90849 => 90850)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-07-12 21:22:45 UTC (rev 90850)
@@ -90,7 +90,7 @@
     void setViewport(const IntRect& visibleRect, const IntRect& contentRect, const IntPoint& scrollPosition);
 
     // updates and draws the current layers onto the backbuffer
-    virtual void updateLayers();
+    void updateLayers();
     void drawLayers();
 
     // Set by WebViewImpl when animation callbacks are running.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (90849 => 90850)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-07-12 21:22:45 UTC (rev 90850)
@@ -91,9 +91,4 @@
 #endif
 }
 
-void CCLayerTreeHost::updateLayers()
-{
-    m_client->updateLayers();
 }
-
-}

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (90849 => 90850)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-07-12 21:22:45 UTC (rev 90850)
@@ -41,7 +41,6 @@
 public:
     virtual void animateAndLayout(double frameBeginTime) = 0;
     virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D() = 0;
-    virtual void updateLayers() = 0;
 
 protected:
     virtual ~CCLayerTreeHostClient() { }
@@ -63,8 +62,6 @@
     void setNeedsCommitAndRedraw();
     void setNeedsRedraw();
 
-    virtual void updateLayers();
-
 protected:
     virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy() = 0;
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp (90849 => 90850)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp	2011-07-12 21:22:45 UTC (rev 90850)
@@ -147,10 +147,6 @@
     }
 
     m_commitPending = false;
-    {
-        TRACE_EVENT("CCLayerTreeHost::updateLayers", this, 0);
-        m_layerTreeHost->updateLayers();
-    }
 
     OwnPtr<CCLayerTreeHostCommitter> committer = m_layerTreeHost->createLayerTreeHostCommitter();
     m_layerTreeHost->beginCommit();

Modified: trunk/Source/WebKit/chromium/ChangeLog (90849 => 90850)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-07-12 21:22:45 UTC (rev 90850)
@@ -1,3 +1,20 @@
+2011-07-12  John Bates  <[email protected]>
+
+        Move call to syncCompositingLayers so that we do not trigger redundant draws.
+        https://bugs.webkit.org/show_bug.cgi?id=64224
+
+        doComposite was triggering two composites every time a canvas was dirtied.
+        By moving syncCompositingLayers call to layout, the client code can draw without triggering
+        a redundant frame. Also renamed WebViewImpl::updateLayers to
+        syncCompositingLayers, because it was confusing.
+
+        Reviewed by James Robinson.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::layout):
+        (WebKit::WebViewImpl::syncCompositingLayers):
+        * src/WebViewImpl.h:
+
 2011-07-12  Sheriff Bot  <[email protected]>
 
         Unreviewed.  Rolled DEPS.

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (90849 => 90850)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-07-12 21:22:45 UTC (rev 90850)
@@ -1059,6 +1059,13 @@
         // layout to be invalidated, so layout needs to be called last.
 
         webframe->layout();
+
+#if USE(ACCELERATED_COMPOSITING)
+        // Call updateLayers here instead of during doComposite so that we don't
+        // trigger another redundant frame during doComposite.
+        if (isAcceleratedCompositingActive())
+            syncCompositingLayers();
+#endif
     }
 }
 
@@ -1143,8 +1150,9 @@
     layout();
 }
 
-void WebViewImpl::updateLayers()
+void WebViewImpl::syncCompositingLayers()
 {
+    TRACE_EVENT("WebViewImpl::syncCompositingLayers", this, 0);
     // Update the compositing requirements for all frame in the tree before doing any painting
     // as the compositing requirements for a RenderLayer within a subframe might change.
     for (Frame* frame = page()->mainFrame(); frame; frame = frame->tree()->traverseNext())

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (90849 => 90850)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-07-12 21:20:35 UTC (rev 90849)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-07-12 21:22:45 UTC (rev 90850)
@@ -206,7 +206,6 @@
     // CCLayerTreeHostClient
     virtual void animateAndLayout(double frameBeginTime);
     virtual PassRefPtr<WebCore::GraphicsContext3D> createLayerTreeHostContext3D();
-    virtual void updateLayers();
 
     // WebViewImpl
 
@@ -432,6 +431,7 @@
     void reallocateRenderer();
     void updateLayerRendererSettings();
     void updateLayerRendererViewport();
+    void syncCompositingLayers();
 #endif
 
     WebViewClient* m_client;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to