Title: [109801] trunk/Source
Revision
109801
Author
[email protected]
Date
2012-03-05 14:01:15 -0800 (Mon, 05 Mar 2012)

Log Message

Always update the scroll layer position on the main thread when we have an overlay
https://bugs.webkit.org/show_bug.cgi?id=80324

Reviewed by Sam Weinig.

Source/WebCore:

Add a way to ensure that scroll layer position updates happen on the main thread.

* WebCore.exp.in:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::ScrollingCoordinator):
(WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread):
(WebCore):
(WebCore::ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):

Source/WebKit2:

Call setForceMainThreadScrollLayerPositionUpdates when installing and uninstalling page overlays,
so we'll be able to synchronize painting between the tile cache and the page overlays.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didInstallPageOverlay):
(WebKit::TiledCoreAnimationDrawingArea::didUninstallPageOverlay):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (109800 => 109801)


--- trunk/Source/WebCore/ChangeLog	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebCore/ChangeLog	2012-03-05 22:01:15 UTC (rev 109801)
@@ -1,3 +1,21 @@
+2012-03-05  Anders Carlsson  <[email protected]>
+
+        Always update the scroll layer position on the main thread when we have an overlay
+        https://bugs.webkit.org/show_bug.cgi?id=80324
+
+        Reviewed by Sam Weinig.
+
+        Add a way to ensure that scroll layer position updates happen on the main thread.
+
+        * WebCore.exp.in:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::ScrollingCoordinator):
+        (WebCore::ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread):
+        (WebCore):
+        (WebCore::ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates):
+        * page/scrolling/ScrollingCoordinator.h:
+        (ScrollingCoordinator):
+
 2012-03-05  Tony Chang  <[email protected]>
 
         Implement flex-wrap: wrap

Modified: trunk/Source/WebCore/WebCore.exp.in (109800 => 109801)


--- trunk/Source/WebCore/WebCore.exp.in	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-03-05 22:01:15 UTC (rev 109801)
@@ -2107,6 +2107,7 @@
 __ZN7WebCore13ScrollingTree22updateBackForwardStateEbb
 __ZN7WebCore13ScrollingTreeD1Ev
 __ZN7WebCore15ScrollingThread8dispatchERKN3WTF8FunctionIFvvEEE
+__ZN7WebCore20ScrollingCoordinator44setForceMainThreadScrollLayerPositionUpdatesEb
 __ZN7WebCore4Page20scrollingCoordinatorEv
 __ZNK7WebCore20ScrollingCoordinator13scrollingTreeEv
 #endif

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (109800 => 109801)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-03-05 22:01:15 UTC (rev 109801)
@@ -53,6 +53,7 @@
 
 ScrollingCoordinator::ScrollingCoordinator(Page* page)
     : m_page(page)
+    , m_forceMainThreadScrollLayerPositionUpdates(false)
 #if ENABLE(THREADED_SCROLLING)
     , m_scrollingTreeState(ScrollingTreeState::create())
     , m_scrollingTree(ScrollingTree::create(this))
@@ -317,9 +318,18 @@
     FrameView* frameView = m_page->mainFrame()->view();
 
     // FIXME: Having fixed objects on the page should not trigger the slow path.
-    setShouldUpdateScrollLayerPositionOnMainThread(frameView->hasSlowRepaintObjects() || frameView->hasFixedObjects());
+    setShouldUpdateScrollLayerPositionOnMainThread(m_forceMainThreadScrollLayerPositionUpdates || frameView->hasSlowRepaintObjects() || frameView->hasFixedObjects());
 }
 
+void ScrollingCoordinator::setForceMainThreadScrollLayerPositionUpdates(bool forceMainThreadScrollLayerPositionUpdates)
+{
+    if (m_forceMainThreadScrollLayerPositionUpdates == forceMainThreadScrollLayerPositionUpdates)
+        return;
+
+    m_forceMainThreadScrollLayerPositionUpdates = forceMainThreadScrollLayerPositionUpdates;
+    updateShouldUpdateScrollLayerPositionOnMainThread();
+}
+
 #if ENABLE(THREADED_SCROLLING)
 void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
 {

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (109800 => 109801)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2012-03-05 22:01:15 UTC (rev 109801)
@@ -112,6 +112,9 @@
     void handleWheelEventPhase(PlatformWheelEventPhase);
 #endif
 
+    // Force all scroll layer position updates to happen on the main thread.
+    void setForceMainThreadScrollLayerPositionUpdates(bool);
+
 private:
     explicit ScrollingCoordinator(Page*);
 
@@ -128,6 +131,8 @@
 
     Page* m_page;
 
+    bool m_forceMainThreadScrollLayerPositionUpdates;
+
 #if ENABLE(THREADED_SCROLLING)
     void scheduleTreeStateCommit();
 

Modified: trunk/Source/WebKit2/ChangeLog (109800 => 109801)


--- trunk/Source/WebKit2/ChangeLog	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebKit2/ChangeLog	2012-03-05 22:01:15 UTC (rev 109801)
@@ -1,3 +1,17 @@
+2012-03-05  Anders Carlsson  <[email protected]>
+
+        Always update the scroll layer position on the main thread when we have an overlay
+        https://bugs.webkit.org/show_bug.cgi?id=80324
+
+        Reviewed by Sam Weinig.
+
+        Call setForceMainThreadScrollLayerPositionUpdates when installing and uninstalling page overlays,
+        so we'll be able to synchronize painting between the tile cache and the page overlays.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::didInstallPageOverlay):
+        (WebKit::TiledCoreAnimationDrawingArea::didUninstallPageOverlay):
+
 2012-03-05  Timothy Hatcher  <[email protected]>
 
         Change how the Web Inspector Develop menu actions work.

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (109800 => 109801)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2012-03-05 21:59:29 UTC (rev 109800)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2012-03-05 22:01:15 UTC (rev 109801)
@@ -146,12 +146,20 @@
 
 void TiledCoreAnimationDrawingArea::didInstallPageOverlay()
 {
+#if ENABLE(THREADED_SCROLLING)
+    m_webPage->corePage()->scrollingCoordinator()->setForceMainThreadScrollLayerPositionUpdates(true);
+#endif
+
     createPageOverlayLayer();
     scheduleCompositingLayerSync();
 }
 
 void TiledCoreAnimationDrawingArea::didUninstallPageOverlay()
 {
+#if ENABLE(THREADED_SCROLLING)
+    m_webPage->corePage()->scrollingCoordinator()->setForceMainThreadScrollLayerPositionUpdates(false);
+#endif
+
     destroyPageOverlayLayer();
     scheduleCompositingLayerSync();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to