Title: [131373] trunk/Source/WebCore
Revision
131373
Author
simon.fra...@apple.com
Date
2012-10-15 15:31:08 -0700 (Mon, 15 Oct 2012)

Log Message

Ensure that GraphicsLayer positions are updated while doing threaded scrolling
https://bugs.webkit.org/show_bug.cgi?id=99372

Reviewed by Anders Carlsson.

When doing threaded scrolling, the scrolling thread updates the positions of CALayers,
but doesn't update GraphicsLayers. This means that code that relies on GraphicsLayer positions
works incorrectly.

Threaded scrolling is not testabled in layout tests.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
(WebCore::GraphicsLayer::syncPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (131372 => 131373)


--- trunk/Source/WebCore/ChangeLog	2012-10-15 22:21:07 UTC (rev 131372)
+++ trunk/Source/WebCore/ChangeLog	2012-10-15 22:31:08 UTC (rev 131373)
@@ -1,3 +1,22 @@
+2012-10-15  Simon Fraser  <simon.fra...@apple.com>
+
+        Ensure that GraphicsLayer positions are updated while doing threaded scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=99372
+
+        Reviewed by Anders Carlsson.
+
+        When doing threaded scrolling, the scrolling thread updates the positions of CALayers,
+        but doesn't update GraphicsLayers. This means that code that relies on GraphicsLayer positions
+        works incorrectly.
+        
+        Threaded scrolling is not testabled in layout tests.
+
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):
+        * platform/graphics/GraphicsLayer.h:
+        (GraphicsLayer):
+        (WebCore::GraphicsLayer::syncPosition):
+
 2012-10-15  Tommy Widenflycht  <tom...@google.com>
 
         MediaStream API: Implement RTCDataChannel

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (131372 => 131373)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-10-15 22:21:07 UTC (rev 131372)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-10-15 22:31:08 UTC (rev 131373)
@@ -235,6 +235,9 @@
     frameView->setConstrainsScrollingToContentEdge(true);
 
     frameView->setInProgrammaticScroll(oldProgrammaticScroll);
+
+    if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView))
+        scrollLayer->syncPosition(-frameView->scrollPosition());
 }
 
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (131372 => 131373)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2012-10-15 22:21:07 UTC (rev 131372)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2012-10-15 22:31:08 UTC (rev 131373)
@@ -246,6 +246,9 @@
     // The position of the layer (the location of its top-left corner in its parent)
     const FloatPoint& position() const { return m_position; }
     virtual void setPosition(const FloatPoint& p) { m_position = p; }
+
+    // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
+    virtual void syncPosition(const FloatPoint& p) { m_position = p; }
     
     // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point
     // affects the origin of the transforms.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to