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

simon.fraser at apple.com simon.fraser at apple.com
Sun Feb 20 23:21:37 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit c961f41a1c641bab3207ef736e95ac50c412ae10
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 20 03:20:47 2011 +0000

    2011-01-19  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Sam Weinig.
    
            GraphicsLayers in subframes can get sync'd multiple times
            https://bugs.webkit.org/show_bug.cgi?id=52489
    
            Some cleanup that will work towards fixing this bug.
    
            Tested by existing iframe compositing tests.
    
            * WebCore.exp.in: syncCompositingStateRecursive()
            was renamed to syncCompositingStateIncludingSubframes().
    
            * page/FrameView.h:
            * page/FrameView.cpp:
            (WebCore::FrameView::syncCompositingStateForThisFrame): Some
            code cleanup: do all the word we need to do for this frame,
            including the needsLayout() check.
            (WebCore::FrameView::syncCompositingStateIncludingSubframes):
            This is no longer recursive; instead, it iterates over descendant
            frames via the frame tree, calling syncCompositingStateForThisFrame()
            on each Frame's view.
    
            * rendering/RenderLayerCompositor.h:
            (WebCore::RenderLayerCompositor::isFlushingLayers): Getter for the flag.
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::RenderLayerCompositor):
            (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Maintain
            a flag to say if we're flushing, which allows us to assert on re-entrant flushes.
            (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
            Add the ability to get the rootmost compositor that is in the middle
            of a flush.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index dd52c45..9537fa6 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2011-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        GraphicsLayers in subframes can get sync'd multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=52489
+
+        Some cleanup that will work towards fixing this bug.
+        
+        Tested by existing iframe compositing tests.
+
+        * WebCore.exp.in: syncCompositingStateRecursive()
+        was renamed to syncCompositingStateIncludingSubframes().
+
+        * page/FrameView.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::syncCompositingStateForThisFrame): Some
+        code cleanup: do all the word we need to do for this frame,
+        including the needsLayout() check.
+        (WebCore::FrameView::syncCompositingStateIncludingSubframes):
+        This is no longer recursive; instead, it iterates over descendant
+        frames via the frame tree, calling syncCompositingStateForThisFrame()
+        on each Frame's view.
+
+        * rendering/RenderLayerCompositor.h:
+        (WebCore::RenderLayerCompositor::isFlushingLayers): Getter for the flag.
+        * rendering/RenderLayerCompositor.cpp: 
+        (WebCore::RenderLayerCompositor::RenderLayerCompositor):
+        (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Maintain
+        a flag to say if we're flushing, which allows us to assert on re-entrant flushes.
+        (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
+        Add the ability to get the rootmost compositor that is in the middle
+        of a flush.
+
 2011-01-19  James Robinson  <jamesr at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index a10d63e..fcb8a00 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -874,7 +874,7 @@ __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
 __ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeEfNS_5Frame19AdjustViewSizeOrNotE
 __ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
-__ZN7WebCore9FrameView29syncCompositingStateRecursiveEv
+__ZN7WebCore9FrameView38syncCompositingStateIncludingSubframesEv
 __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
 __ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
 __ZN7WebCore9FrameView6createEPNS_5FrameE
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 51d226f..6ed0daf 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -562,10 +562,19 @@ void FrameView::updateCompositingLayers()
 #endif
 }
 
-void FrameView::syncCompositingStateForThisFrame()
+bool FrameView::syncCompositingStateForThisFrame()
 {
-    if (RenderView* view = m_frame->contentRenderer())
-        view->compositor()->flushPendingLayerChanges();
+    ASSERT(m_frame->view() == this);
+    RenderView* view = m_frame->contentRenderer();
+    if (!view)
+        return true; // We don't want to keep trying to update layers if we have no renderer.
+
+    // If we sync compositing layers when a layout is pending, we may cause painting of compositing
+    // layer content to occur before layout has happened, which will cause paintContents() to bail.
+    if (needsLayout())
+        return false;
+
+    view->compositor()->flushPendingLayerChanges();
 
 #if ENABLE(FULLSCREEN_API)
     // The fullScreenRenderer's graphicsLayer  has been re-parented, and the above recursive syncCompositingState
@@ -577,7 +586,8 @@ void FrameView::syncCompositingStateForThisFrame()
         if (GraphicsLayer* fullScreenLayer = backing->graphicsLayer())
             fullScreenLayer->syncCompositingState();
     }
-#endif    
+#endif
+    return true;
 }
 
 void FrameView::setNeedsOneShotDrawingSynchronization()
@@ -656,32 +666,16 @@ bool FrameView::isEnclosedInCompositingLayer() const
     return false;
 }
     
-bool FrameView::syncCompositingStateRecursive()
+bool FrameView::syncCompositingStateIncludingSubframes()
 {
 #if USE(ACCELERATED_COMPOSITING)
-    ASSERT(m_frame->view() == this);
-    RenderView* contentRenderer = m_frame->contentRenderer();
-    if (!contentRenderer)
-        return true;    // We don't want to keep trying to update layers if we have no renderer.
-
-    // If we sync compositing layers when a layout is pending, we may cause painting of compositing
-    // layer content to occur before layout has happened, which will cause paintContents() to bail.
-    if (needsLayout())
-        return false;
-    
-    syncCompositingStateForThisFrame();
+    bool allFramesSynced = syncCompositingStateForThisFrame();
     
-    bool allSubframesSynced = true;
-    const HashSet<RefPtr<Widget> >* viewChildren = children();
-    HashSet<RefPtr<Widget> >::const_iterator end = viewChildren->end();
-    for (HashSet<RefPtr<Widget> >::const_iterator current = viewChildren->begin(); current != end; ++current) {
-        Widget* widget = (*current).get();
-        if (widget->isFrameView()) {
-            bool synced = static_cast<FrameView*>(widget)->syncCompositingStateRecursive();
-            allSubframesSynced &= synced;
-        }
+    for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->traverseNext(m_frame.get())) {
+        bool synced = child->view()->syncCompositingStateForThisFrame();
+        allFramesSynced &= synced;
     }
-    return allSubframesSynced;
+    return allFramesSynced;
 #else // USE(ACCELERATED_COMPOSITING)
     return true;
 #endif
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 9beca93..efe9769 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -106,7 +106,7 @@ public:
 
 #if USE(ACCELERATED_COMPOSITING)
     void updateCompositingLayers();
-    void syncCompositingStateForThisFrame();
+    bool syncCompositingStateForThisFrame();
 
     // Called when changes to the GraphicsLayer hierarchy have to be synchronized with
     // content rendered via the normal painting path.
@@ -121,7 +121,7 @@ public:
 
     // Only used with accelerated compositing, but outside the #ifdef to make linkage easier.
     // Returns true if the sync was completed.
-    bool syncCompositingStateRecursive();
+    bool syncCompositingStateIncludingSubframes();
 
     // Returns true when a paint with the PaintBehaviorFlattenCompositingLayers flag set gives
     // a faithful representation of the content.
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 17f16c3..4611fa4 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -102,6 +102,7 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
     , m_compositingDependsOnGeometry(false)
     , m_compositing(false)
     , m_compositingLayersNeedRebuild(false)
+    , m_flushingLayers(false)
     , m_rootLayerAttachment(RootLayerUnattached)
 #if PROFILE_LAYER_REBUILD
     , m_rootLayerUpdateCount(0)
@@ -182,12 +183,32 @@ void RenderLayerCompositor::scheduleLayerFlush()
 
 void RenderLayerCompositor::flushPendingLayerChanges()
 {
+    ASSERT(!m_flushingLayers);
+    m_flushingLayers = true;
+
     // FIXME: FrameView::syncCompositingStateRecursive() calls this for each
     // frame, so when compositing layers are connected between frames, we'll
     // end up syncing subframe's layers multiple times.
     // https://bugs.webkit.org/show_bug.cgi?id=52489
     if (GraphicsLayer* rootLayer = rootPlatformLayer())
         rootLayer->syncCompositingState();
+
+    ASSERT(m_flushingLayers);
+    m_flushingLayers = false;
+}
+
+RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const
+{
+    if (!m_renderView->frameView())
+        return 0;
+
+    for (Frame* frame = m_renderView->frameView()->frame(); frame; frame = frame->tree()->parent()) {
+        RenderLayerCompositor* compositor = frame->contentRenderer() ? frame->contentRenderer()->compositor() : 0;
+        if (compositor->isFlushingLayers())
+            return compositor;
+    }
+    
+    return 0;
 }
 
 void RenderLayerCompositor::scheduleCompositingLayerUpdate()
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.h b/Source/WebCore/rendering/RenderLayerCompositor.h
index fc36dca..32d64d3 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.h
+++ b/Source/WebCore/rendering/RenderLayerCompositor.h
@@ -88,6 +88,11 @@ public:
     // at specific times.
     void scheduleLayerFlush();
     void flushPendingLayerChanges();
+    bool isFlushingLayers() const { return m_flushingLayers; }
+    
+    // flushPendingLayerChanges() flushes the entire GraphicsLayer tree, which can cross frame boundaries.
+    // This call returns the rootmost compositor that is being flushed (including self).
+    RenderLayerCompositor* enclosingCompositorFlushingLayers() const;
     
     // Rebuild the tree of compositing layers
     void updateCompositingLayers(CompositingUpdateType = CompositingUpdateAfterLayoutOrStyleChange, RenderLayer* updateRoot = 0);
@@ -266,6 +271,7 @@ private:
 
     bool m_compositing;
     bool m_compositingLayersNeedRebuild;
+    bool m_flushingLayers;
 
     RootLayerAttachment m_rootLayerAttachment;
 
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 3e6ae7e..4f0d2ef 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        GraphicsLayers in subframes can get sync'd multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=52489
+
+        * WebView/WebView.mm:
+        (-[WebView _syncCompositingChanges]): syncCompositingStateRecursive()
+        was renamed to syncCompositingStateIncludingSubframes().
+
 2011-01-19  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index 720022b..adb83e4 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -5956,7 +5956,7 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num)
 {
     Frame* frame = [self _mainCoreFrame];
     if (frame && frame->view())
-        return frame->view()->syncCompositingStateRecursive();
+        return frame->view()->syncCompositingStateIncludingSubframes();
 
     return YES;
 }
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 1d35a9e..ffd1ae6 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        GraphicsLayers in subframes can get sync'd multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=52489
+
+        * WebCoreSupport/PageClientQt.cpp:
+        (WebCore::PageClientQWidget::syncLayers): syncCompositingStateRecursive()
+        was renamed to syncCompositingStateIncludingSubframes().
+
 2011-01-19  Csaba Osztrogonác  <ossy at webkit.org>
 
         Reviewed by Laszlo Gombos and Tor Arne Vestbø.
diff --git a/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index c3869c5..1821bec 100644
--- a/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -170,7 +170,7 @@ void PageClientQWidget::markForSync(bool scheduleSync)
 
 void PageClientQWidget::syncLayers(Timer<PageClientQWidget>*)
 {
-    QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+    QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateIncludingSubframes();
 }
 #endif
 
@@ -321,7 +321,7 @@ void PageClientQGraphicsWidget::createOrDeleteOverlay()
 void PageClientQGraphicsWidget::syncLayers()
 {
     if (shouldSync) {
-        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateIncludingSubframes();
         shouldSync = false;
     }
 }
@@ -342,7 +342,7 @@ void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsObject* layer)
     if (rootGraphicsLayer) {
         rootGraphicsLayer.data()->setParentItem(0);
         view->scene()->removeItem(rootGraphicsLayer.data());
-        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
+        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateIncludingSubframes();
     }
 
     rootGraphicsLayer = layer;
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index f26f0f2..a564330 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        GraphicsLayers in subframes can get sync'd multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=52489
+
+        * WebView.cpp:
+        (WebView::syncCompositingState): syncCompositingStateRecursive()
+        was renamed to syncCompositingStateIncludingSubframes().
+
 2011-01-17  Adam Roben  <aroben at apple.com>
 
         Update for WKCACFLayerRenderer changes
diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp
index ae91724..4c6a423 100644
--- a/Source/WebKit/win/WebView.cpp
+++ b/Source/WebKit/win/WebView.cpp
@@ -6522,7 +6522,7 @@ void WebView::syncCompositingState()
     if (m_backingLayer)
         m_backingLayer->syncCompositingStateForThisLayerOnly();
 
-    view->syncCompositingStateRecursive();
+    view->syncCompositingStateIncludingSubframes();
 }
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list