[chromium] scroll deltas are cleared during commit to the main thread
authorhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 10:52:27 +0000 (10:52 +0000)
committerhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Nov 2011 10:52:27 +0000 (10:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71916

Reviewed by James Robinson.

Source/WebCore:

Patch is covered by unit test.

Add a member m_sentScrollDelta to CCLayerImpl to keep track of the scroll delta being
sent to the main thread during commit. This gives a simpler approach to keep tracking of a
layer's scroll delta in impl thread.

* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::sentScrollDelta):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::sentScrollDelta):
(WebCore::CCLayerImpl::setSentScrollDelta):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::processScrollDeltas):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:

Source/WebKit/chromium:

Modify test to verify sentScrollDeltas() values of CCLayerImpl during commit.

* tests/CCLayerTreeHostImplTest.cpp:
(WebKit::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100258 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp

index b84bf43..394d9d9 100644 (file)
@@ -1,3 +1,25 @@
+2011-11-15  Alpha Lam  <hclam@chromium.org>
+
+        [chromium] scroll deltas are cleared during commit to the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=71916
+
+        Reviewed by James Robinson.
+
+        Patch is covered by unit test.
+
+        Add a member m_sentScrollDelta to CCLayerImpl to keep track of the scroll delta being
+        sent to the main thread during commit. This gives a simpler approach to keep tracking of a
+        layer's scroll delta in impl thread.
+
+        * platform/graphics/chromium/LayerChromium.h:
+        (WebCore::LayerChromium::sentScrollDelta):
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        (WebCore::CCLayerImpl::sentScrollDelta):
+        (WebCore::CCLayerImpl::setSentScrollDelta):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::processScrollDeltas):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+
 2011-11-15  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] REGRESSION(100123): It made inspector tests crash
index ca00c23..362908d 100644 (file)
@@ -301,6 +301,7 @@ void LayerChromium::pushPropertiesTo(CCLayerImpl* layer)
     layer->setSublayerTransform(m_sublayerTransform);
     layer->setTransform(m_transform);
     layer->setUpdateRect(m_updateRect);
+    layer->setSentScrollDelta(IntSize());
 
     if (maskLayer())
         maskLayer()->pushPropertiesTo(layer->maskLayer());
index 486f3a1..5241335 100644 (file)
@@ -163,6 +163,9 @@ public:
     float scaleDelta() const { return m_scaleDelta; }
     void setScaleDelta(float);
 
+    const IntSize& sentScrollDelta() const { return m_sentScrollDelta; }
+    void setSentScrollDelta(const IntSize& sentScrollDelta) { m_sentScrollDelta = sentScrollDelta; }
+
     void scrollBy(const IntSize& scroll);
 
     bool scrollable() const { return m_scrollable; }
@@ -248,6 +251,7 @@ private:
     bool m_drawsContent;
 
     IntSize m_scrollDelta;
+    IntSize m_sentScrollDelta;
     IntSize m_maxScrollPosition;
     float m_scaleDelta;
 
index 03e2c70..25a8180 100644 (file)
@@ -342,6 +342,7 @@ PassOwnPtr<CCScrollAndScaleSet> CCLayerTreeHostImpl::processScrollDeltas()
 
     m_scrollLayerImpl->setScrollPosition(m_scrollLayerImpl->scrollPosition() + m_scrollLayerImpl->scrollDelta());
     m_scrollLayerImpl->setPosition(m_scrollLayerImpl->position() - m_scrollLayerImpl->scrollDelta());
+    m_scrollLayerImpl->setSentScrollDelta(m_scrollLayerImpl->scrollDelta());
     m_scrollLayerImpl->setScrollDelta(IntSize());
 
     return scrollInfo.release();
index 3c2a580..a93c7d6 100644 (file)
@@ -1,3 +1,15 @@
+2011-11-15  Alpha Lam  <hclam@chromium.org>
+
+        [chromium] scroll deltas are cleared during commit to the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=71916
+
+        Reviewed by James Robinson.
+
+        Modify test to verify sentScrollDeltas() values of CCLayerImpl during commit.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+        (WebKit::TEST_F):
+
 2011-11-14  Julien Chaffraix  <jchaffraix@webkit.org>
 
         [chromium] Fix the build after moving some arrays to WTF
index f78784d..44813e5 100644 (file)
@@ -127,6 +127,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollDeltaRepeatedScrolls)
     scrollInfo = m_hostImpl->processScrollDeltas();
     ASSERT_EQ(root->scrollPosition(), scrollPosition + scrollDelta);
     ASSERT_EQ(scrollInfo->scrolls.size(), 1u);
+    EXPECT_EQ(root->sentScrollDelta(), scrollDelta);
     expectContains(*scrollInfo.get(), root->id(), scrollDelta);
     expectClearedScrollDeltasRecursive(root.get());