Changeset 90850 in webkit


Ignore:
Timestamp:
Jul 12, 2011 2:22:45 PM (13 years ago)
Author:
commit-queue@webkit.org
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 <jbates@google.com> 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 <jbates@google.com> on 2011-07-12
Reviewed by James Robinson.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::layout):
(WebKit::WebViewImpl::syncCompositingLayers):

  • src/WebViewImpl.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90849 r90850  
     12011-07-12  John Bates  <jbates@google.com>
     2
     3        Move call to syncCompositingLayers so that we do not trigger redundant draws.
     4        https://bugs.webkit.org/show_bug.cgi?id=64224
     5
     6        doComposite was triggering two composites every time a canvas was dirtied.
     7        By moving syncCompositingLayers call to layout, the client code can draw without triggering
     8        a redundant frame. Also renamed WebViewImpl::updateLayers to
     9        syncCompositingLayers, because it was confusing. CCLayerTreeHostImplProxy::updateLayers was
     10        no longer needed, because animateAndLayout calls WebViewImpl::layout.
     11
     12        Reviewed by James Robinson.
     13
     14        * platform/graphics/chromium/LayerRendererChromium.cpp:
     15        (WebCore::LayerRendererChromium::updateLayers):
     16        * platform/graphics/chromium/LayerRendererChromium.h:
     17        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     18        (WebCore::CCLayerTreeHost::syncCompositingLayers):
     19        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     20        * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp:
     21        (WebCore::CCLayerTreeHostImplProxy::requestFrameAndCommit):
     22
    1232011-07-12  Ryosuke Niwa  <rniwa@webkit.org>
    224
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r90842 r90850  
    250250void LayerRendererChromium::updateLayers()
    251251{
    252     CCLayerTreeHost::updateLayers();
    253252    if (m_viewportVisibleRect.isEmpty())
    254253        return;
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r90505 r90850  
    9191
    9292    // updates and draws the current layers onto the backbuffer
    93     virtual void updateLayers();
     93    void updateLayers();
    9494    void drawLayers();
    9595
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r89837 r90850  
    9292}
    9393
    94 void CCLayerTreeHost::updateLayers()
    95 {
    96     m_client->updateLayers();
    9794}
    98 
    99 }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r89837 r90850  
    4242    virtual void animateAndLayout(double frameBeginTime) = 0;
    4343    virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D() = 0;
    44     virtual void updateLayers() = 0;
    4544
    4645protected:
     
    6463    void setNeedsRedraw();
    6564
    66     virtual void updateLayers();
    67 
    6865protected:
    6966    virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy() = 0;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp

    r89837 r90850  
    148148
    149149    m_commitPending = false;
    150     {
    151         TRACE_EVENT("CCLayerTreeHost::updateLayers", this, 0);
    152         m_layerTreeHost->updateLayers();
    153     }
    154150
    155151    OwnPtr<CCLayerTreeHostCommitter> committer = m_layerTreeHost->createLayerTreeHostCommitter();
  • trunk/Source/WebKit/chromium/ChangeLog

    r90843 r90850  
     12011-07-12  John Bates  <jbates@google.com>
     2
     3        Move call to syncCompositingLayers so that we do not trigger redundant draws.
     4        https://bugs.webkit.org/show_bug.cgi?id=64224
     5
     6        doComposite was triggering two composites every time a canvas was dirtied.
     7        By moving syncCompositingLayers call to layout, the client code can draw without triggering
     8        a redundant frame. Also renamed WebViewImpl::updateLayers to
     9        syncCompositingLayers, because it was confusing.
     10
     11        Reviewed by James Robinson.
     12
     13        * src/WebViewImpl.cpp:
     14        (WebKit::WebViewImpl::layout):
     15        (WebKit::WebViewImpl::syncCompositingLayers):
     16        * src/WebViewImpl.h:
     17
    1182011-07-12  Sheriff Bot  <webkit.review.bot@gmail.com>
    219
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r90505 r90850  
    10601060
    10611061        webframe->layout();
     1062
     1063#if USE(ACCELERATED_COMPOSITING)
     1064        // Call updateLayers here instead of during doComposite so that we don't
     1065        // trigger another redundant frame during doComposite.
     1066        if (isAcceleratedCompositingActive())
     1067            syncCompositingLayers();
     1068#endif
    10621069    }
    10631070}
     
    11441151}
    11451152
    1146 void WebViewImpl::updateLayers()
    1147 {
     1153void WebViewImpl::syncCompositingLayers()
     1154{
     1155    TRACE_EVENT("WebViewImpl::syncCompositingLayers", this, 0);
    11481156    // Update the compositing requirements for all frame in the tree before doing any painting
    11491157    // as the compositing requirements for a RenderLayer within a subframe might change.
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r89837 r90850  
    207207    virtual void animateAndLayout(double frameBeginTime);
    208208    virtual PassRefPtr<WebCore::GraphicsContext3D> createLayerTreeHostContext3D();
    209     virtual void updateLayers();
    210209
    211210    // WebViewImpl
     
    433432    void updateLayerRendererSettings();
    434433    void updateLayerRendererViewport();
     434    void syncCompositingLayers();
    435435#endif
    436436
Note: See TracChangeset for help on using the changeset viewer.