Changeset 151220 in webkit


Ignore:
Timestamp:
Jun 5, 2013 6:33:43 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[Coordinated Graphics] Prevent a recursive painting in CoordinatedGraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=117222

Patch by Gwang Yoon Hwang <ryumiel@company100.net> on 2013-06-05
Reviewed by Noam Rosenthal.

CoordinatedGraphicsLayer::flushCompositingState() will cross frame
boundaries if the GraphicsLayers are connected. In this case,
updateContentBuffers will invoke a painting of a sub-frame that causes
flushCompositingState recursively.

Source/WebCore:

To prevent this behavior this patch extracts updateContentBuffers from
flushCompositingState, and places it in
updateContentBuffersIncludeSublayers, which is another tree traveler for
painting.

No new tests, covered by existing tests.

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit2:

To prevent this behavior this patch extracts updateContentBuffers from
flushCompositingState, and places it in
updateContentBuffersIncludeSublayers, which traverses the tree
separately from flushing the state for painting.

No new tests, covered by existing tests.

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:

(WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151218 r151220  
     12013-06-05  Gwang Yoon Hwang  <ryumiel@company100.net>
     2
     3        [Coordinated Graphics] Prevent a recursive painting in CoordinatedGraphicsLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=117222
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        CoordinatedGraphicsLayer::flushCompositingState() will cross frame
     9        boundaries if the GraphicsLayers are connected. In this case,
     10        updateContentBuffers will invoke a painting of a sub-frame that causes
     11        flushCompositingState recursively.
     12
     13        To prevent this behavior this patch extracts updateContentBuffers from
     14        flushCompositingState, and places it in
     15        updateContentBuffersIncludeSublayers, which is another tree traveler for
     16        painting.
     17
     18        No new tests, covered by existing tests.
     19
     20        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     21        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
     22        (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
     23        (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
     24        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
     25
    1262013-06-05  Andreas Kling  <akling@apple.com>
    227
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r149292 r151220  
    791791    syncFilters();
    792792#endif
    793     updateContentBuffers();
    794793#if USE(GRAPHICS_SURFACE)
    795794    syncCanvas();
    796795#endif
    797796
     797    // Only unset m_movingVisibleRect after we have updated the visible rect after the animation stopped.
     798    if (!hasActiveTransformAnimation)
     799        m_movingVisibleRect = false;
     800}
     801
     802void CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers()
     803{
    798804    if (m_layerState.hasPendingChanges()) {
    799805        m_coordinator->syncLayerState(m_id, m_layerState);
     
    801807    }
    802808
    803     // Only unset m_movingVisibleRect after we have updated the visible rect after the animation stopped.
    804     if (!hasActiveTransformAnimation)
    805         m_movingVisibleRect = false;
     809    for (size_t i = 0; i < children().size(); ++i)
     810        toCoordinatedGraphicsLayer(children()[i])->syncPendingStateChangesIncludingSubLayers();
    806811}
    807812
     
    994999}
    9951000
     1001void CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers()
     1002{
     1003    if (CoordinatedGraphicsLayer* mask = toCoordinatedGraphicsLayer(maskLayer()))
     1004        mask->updateContentBuffers();
     1005
     1006    if (CoordinatedGraphicsLayer* replica = toCoordinatedGraphicsLayer(replicaLayer()))
     1007        replica->updateContentBuffers();
     1008
     1009    updateContentBuffers();
     1010
     1011    for (size_t i = 0; i < children().size(); ++i)
     1012        toCoordinatedGraphicsLayer(children()[i])->updateContentBuffersIncludingSubLayers();
     1013}
     1014
    9961015void CoordinatedGraphicsLayer::updateContentBuffers()
    9971016{
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h

    r149292 r151220  
    112112    virtual void resumeAnimations() OVERRIDE;
    113113
     114    void syncPendingStateChangesIncludingSubLayers();
     115    void updateContentBuffersIncludingSubLayers();
     116
    114117    FloatPoint computePositionRelativeToBase();
    115118    void computePixelAlignment(FloatPoint& position, FloatSize&, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset);
  • trunk/Source/WebKit2/ChangeLog

    r151214 r151220  
     12013-06-05  Gwang Yoon Hwang  <ryumiel@company100.net>
     2
     3        [Coordinated Graphics] Prevent a recursive painting in CoordinatedGraphicsLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=117222
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        CoordinatedGraphicsLayer::flushCompositingState() will cross frame
     9        boundaries if the GraphicsLayers are connected. In this case,
     10        updateContentBuffers will invoke a painting of a sub-frame that causes
     11        flushCompositingState recursively.
     12
     13        To prevent this behavior this patch extracts updateContentBuffers from
     14        flushCompositingState, and places it in
     15        updateContentBuffersIncludeSublayers, which traverses the tree
     16        separately from flushing the state for painting.
     17
     18        No new tests, covered by existing tests.
     19
     20        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     21        (WebKit::CoordinatedLayerTreeHost::flushPendingLayerChanges):
     22
    1232013-06-05  Gwang Yoon Hwang  <ryumiel@company100.net>
    224
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r151212 r151220  
    249249    bool didSync = m_webPage->corePage()->mainFrame()->view()->flushCompositingStateIncludingSubframes();
    250250
     251    toCoordinatedGraphicsLayer(m_rootLayer.get())->updateContentBuffersIncludingSubLayers();
     252    toCoordinatedGraphicsLayer(m_rootLayer.get())->syncPendingStateChangesIncludingSubLayers();
     253
    251254    flushPendingImageBackingChanges();
    252255
Note: See TracChangeset for help on using the changeset viewer.