Title: [100060] trunk/Source
Revision
100060
Author
[email protected]
Date
2011-11-11 18:56:27 -0800 (Fri, 11 Nov 2011)

Log Message

Rollout http://trac.webkit.org/changeset/99844
Solution is more complicated than the problem it was intended to solve.

Source/WebCore:

* platform/graphics/chromium/LayerChromium.cpp:
* platform/graphics/chromium/LayerChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
* platform/graphics/chromium/cc/CCLayerImpl.h:
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::applyScrollAndScale):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.h:
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::processScrollDeltas):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::beginFrameAndCommit):
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (100059 => 100060)


--- trunk/Source/WebCore/ChangeLog	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/ChangeLog	2011-11-12 02:56:27 UTC (rev 100060)
@@ -1,3 +1,24 @@
+2011-11-11  James Robinson  <[email protected]>
+
+        Rollout http://trac.webkit.org/changeset/99844
+        Solution is more complicated than the problem it was intended to solve.
+
+        * platform/graphics/chromium/LayerChromium.cpp:
+        * platform/graphics/chromium/LayerChromium.h:
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        * platform/graphics/chromium/cc/CCLayerImpl.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::applyScrollAndScale):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.h:
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::processScrollDeltas):
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::beginFrameAndCommit):
+        (WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+
 2011-11-11  Levi Weintraub  <[email protected]>
 
         Revert Page to operate on integers

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -104,15 +104,6 @@
     cleanupResources();
 }
 
-void LayerChromium::applyScrollAndScale(const IntSize& scrollDelta, float pageScale)
-{
-    // FIXME: apply scroll delta not just to CCLayerTreeHostClient.
-    if (!layerTreeHost() || !layerTreeHost()->client())
-        return;
-
-    layerTreeHost()->client()->applyScrollAndScale(scrollDelta, pageScale);
-}
-
 void LayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
 {
     // If we're changing layer renderers then we need to free up any resources

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h	2011-11-12 02:56:27 UTC (rev 100060)
@@ -135,7 +135,6 @@
     void setScrollable(bool scrollable) { m_scrollable = true;  setNeedsCommit(); }
 
     IntSize scrollDelta() const { return IntSize(); }
-    void applyScrollAndScale(const IntSize& scrollDelta, float pageScale);
 
     bool doubleSided() const { return m_doubleSided; }
     void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -395,11 +395,6 @@
     }
 }
 
-void CCLayerImpl::applyScrollAndScale(const IntSize& scrollDelta, float pageScale)
-{
-    m_scrollDelta -= scrollDelta;
-}
-
 void CCLayerImpl::setDoubleSided(bool doubleSided)
 {
     if (m_doubleSided != doubleSided) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h	2011-11-12 02:56:27 UTC (rev 100060)
@@ -162,8 +162,6 @@
     bool scrollable() const { return m_scrollable; }
     void setScrollable(bool scrollable) { m_scrollable = scrollable; }
 
-    void applyScrollAndScale(const IntSize& scrollDelta, float pageScale);
-
     const IntRect& visibleLayerRect() const { return m_visibleLayerRect; }
     void setVisibleLayerRect(const IntRect& visibleLayerRect) { m_visibleLayerRect = visibleLayerRect; }
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -461,6 +461,17 @@
     m_updateList.clear();
 }
 
+void CCLayerTreeHost::applyScrollAndScale(const CCScrollAndScaleSet& info)
+{
+    // FIXME: pushing scroll offsets to non-root layers not implemented
+    if (!info.scrolls.size())
+        return;
+
+    ASSERT(info.scrolls.size() == 1);
+    IntSize scrollDelta = info.scrolls[0].scrollDelta;
+    m_client->applyScrollAndScale(scrollDelta, info.pageScale);
+}
+
 void CCLayerTreeHost::startRateLimiter(GraphicsContext3D* context)
 {
     if (animating())

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2011-11-12 02:56:27 UTC (rev 100060)
@@ -174,6 +174,7 @@
     void updateLayers();
 
     void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
+    void applyScrollAndScale(const CCScrollAndScaleSet&);
     void startRateLimiter(GraphicsContext3D*);
     void stopRateLimiter(GraphicsContext3D*);
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -433,17 +433,6 @@
         sortLayers(&descendants.at(sortingStartIndex), descendants.end(), layerSorter);
 }
 
-template<typename LayerType>
-static void applyScrollAndScaleInternal(LayerType* rootLayer, const CCScrollAndScaleSet& scrollInfo)
-{
-    if (!rootLayer || !scrollInfo.scrolls.size())
-        return;
-
-    // FIXME: apply scroll deltas from layer other than the root.
-    ASSERT(scrollInfo.scrolls.size() == 1 && scrollInfo.scrolls[0].layerId == rootLayer->id());
-    rootLayer->applyScrollAndScale(scrollInfo.scrolls[0].scrollDelta, scrollInfo.pageScale);
-}
-
 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(LayerChromium* layer, LayerChromium* rootLayer, const TransformationMatrix& parentMatrix, const TransformationMatrix& fullHierarchyMatrix, Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList, Vector<RefPtr<LayerChromium> >& layerList, int maxTextureSize)
 {
     return WebCore::calculateDrawTransformsAndVisibilityInternal<LayerChromium, RenderSurfaceChromium, void*>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, renderSurfaceLayerList, layerList, 0, maxTextureSize);
@@ -454,14 +443,4 @@
     return calculateDrawTransformsAndVisibilityInternal<CCLayerImpl, CCRenderSurface, CCLayerSorter>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, renderSurfaceLayerList, layerList, layerSorter, maxTextureSize);
 }
 
-void CCLayerTreeHostCommon::applyScrollAndScale(LayerChromium* rootLayer, const CCScrollAndScaleSet& scrollInfo)
-{
-    applyScrollAndScaleInternal(rootLayer, scrollInfo);
-}
-
-void CCLayerTreeHostCommon::applyScrollAndScale(CCLayerImpl* rootLayer, const CCScrollAndScaleSet& scrollInfo)
-{
-    applyScrollAndScaleInternal(rootLayer, scrollInfo);
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h	2011-11-12 02:56:27 UTC (rev 100060)
@@ -49,17 +49,13 @@
         int layerId;
         IntSize scrollDelta;
     };
-    struct ScrollAndScaleSet {
-        Vector<ScrollUpdateInfo> scrolls;
-        float pageScale;
-    };
+};
 
-    static void applyScrollAndScale(LayerChromium* rootLayer, const ScrollAndScaleSet& scrollInfo);
-    static void applyScrollAndScale(CCLayerImpl* rootLayer, const ScrollAndScaleSet& scrollInfo);
+struct CCScrollAndScaleSet {
+    Vector<CCLayerTreeHostCommon::ScrollUpdateInfo> scrolls;
+    float pageScale;
 };
 
-typedef CCLayerTreeHostCommon::ScrollAndScaleSet CCScrollAndScaleSet;
-
 template<typename LayerType>
 IntRect CCLayerTreeHostCommon::calculateVisibleLayerRect(LayerType* layer)
 {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -338,6 +338,10 @@
     scroll.scrollDelta = m_scrollLayerImpl->scrollDelta();
     scrollInfo->scrolls.append(scroll);
 
+    m_scrollLayerImpl->setScrollPosition(m_scrollLayerImpl->scrollPosition() + m_scrollLayerImpl->scrollDelta());
+    m_scrollLayerImpl->setPosition(m_scrollLayerImpl->position() - m_scrollLayerImpl->scrollDelta());
+    m_scrollLayerImpl->setScrollDelta(IntSize());
+
     return scrollInfo.release();
 }
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -32,7 +32,6 @@
 #include "cc/CCFrameRateController.h"
 #include "cc/CCInputHandler.h"
 #include "cc/CCLayerTreeHost.h"
-#include "cc/CCLayerTreeHostCommon.h"
 #include "cc/CCMainThreadTask.h"
 #include "cc/CCScheduler.h"
 #include "cc/CCScopedMainThreadProxy.h"
@@ -355,7 +354,7 @@
         return;
 
     // Scroll deltas need to be applied even if the commit will be dropped.
-    CCLayerTreeHostCommon::applyScrollAndScale(m_layerTreeHost->rootLayer(), *scrollInfo);
+    m_layerTreeHost->applyScrollAndScale(*scrollInfo.get());
 
     // Drop beginFrameAndCommit calls that occur out of sequence. See createBeginFrameAndCommitTaskOnImplThread for
     // an explanation of how out-of-sequence beginFrameAndCommit tasks can occur.
@@ -387,7 +386,7 @@
         // coordinated by the CCScheduler.
         TRACE_EVENT("commit", this, 0);
         CCCompletionEvent completion;
-        s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, AllowCrossThreadAccess(&completion), scrollInfo));
+        s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::beginFrameCompleteOnImplThread, AllowCrossThreadAccess(&completion)));
         completion.wait();
     }
 
@@ -396,7 +395,7 @@
     ASSERT(m_lastExecutedBeginFrameAndCommitSequenceNumber == sequenceNumber);
 }
 
-void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion, PassOwnPtr<CCScrollAndScaleSet> scrollInfo)
+void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion)
 {
     TRACE_EVENT("CCThreadProxy::beginFrameCompleteOnImplThread", this, 0);
     ASSERT(!m_commitCompletionEventOnImplThread);
@@ -413,7 +412,6 @@
     ASSERT(!m_currentTextureUpdaterOnImplThread);
     m_currentTextureUpdaterOnImplThread = adoptPtr(new CCTextureUpdater(m_layerTreeHostImpl->contentsTextureAllocator()));
     m_layerTreeHost->updateCompositorResources(m_layerTreeHostImpl->context(), *m_currentTextureUpdaterOnImplThread);
-    CCLayerTreeHostCommon::applyScrollAndScale(m_layerTreeHostImpl->scrollLayer(), *scrollInfo);
 
     m_schedulerOnImplThread->beginFrameComplete();
 }

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h (100059 => 100060)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2011-11-12 02:56:27 UTC (rev 100060)
@@ -93,7 +93,7 @@
     };
     PassOwnPtr<CCMainThread::Task> createBeginFrameAndCommitTaskOnImplThread();
     void obtainBeginFrameAndCommitTaskFromCCThread(CCCompletionEvent*, CCMainThread::Task**);
-    void beginFrameCompleteOnImplThread(CCCompletionEvent*, PassOwnPtr<CCScrollAndScaleSet>);
+    void beginFrameCompleteOnImplThread(CCCompletionEvent*);
     void requestReadbackOnImplThread(ReadbackRequest*);
     void finishAllRenderingOnImplThread(CCCompletionEvent*);
     void initializeImplOnImplThread(CCCompletionEvent*);

Modified: trunk/Source/WebKit/chromium/ChangeLog (100059 => 100060)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-12 02:56:27 UTC (rev 100060)
@@ -1,3 +1,11 @@
+2011-11-11  James Robinson  <[email protected]>
+
+        Rollout http://trac.webkit.org/changeset/99844
+        Solution is more complicated than the problem it was intended to solve.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+        (WebKit::TEST_F):
+
 2011-11-11  Iain Merrick  <[email protected]>
 
         [chromium] CCThreadProxy::finishAllRendering hangs if !visible

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (100059 => 100060)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2011-11-12 02:53:52 UTC (rev 100059)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2011-11-12 02:56:27 UTC (rev 100060)
@@ -30,7 +30,6 @@
 #include "LayerRendererChromium.h"
 #include "MockWebGraphicsContext3D.h"
 #include "cc/CCLayerImpl.h"
-#include "cc/CCLayerTreeHostCommon.h"
 #include "cc/CCSingleThreadProxy.h"
 #include <gtest/gtest.h>
 
@@ -126,22 +125,22 @@
     OwnPtr<CCScrollAndScaleSet> scrollInfo;
 
     scrollInfo = m_hostImpl->processScrollDeltas();
-    ASSERT_EQ(root->scrollPosition(), scrollPosition);
+    ASSERT_EQ(root->scrollPosition(), scrollPosition + scrollDelta);
     ASSERT_EQ(scrollInfo->scrolls.size(), 1u);
     expectContains(*scrollInfo.get(), root->id(), scrollDelta);
+    expectClearedScrollDeltasRecursive(root.get());
 
     IntSize scrollDelta2(-5, 27);
     root->scrollBy(scrollDelta2);
     scrollInfo = m_hostImpl->processScrollDeltas();
-    ASSERT_EQ(root->scrollPosition(), scrollPosition);
+    ASSERT_EQ(root->scrollPosition(), scrollPosition + scrollDelta + scrollDelta2);
     ASSERT_EQ(scrollInfo->scrolls.size(), 1u);
-    expectContains(*scrollInfo, root->id(), scrollDelta + scrollDelta2);
-    EXPECT_EQ(root->scrollDelta(), scrollDelta + scrollDelta2);
+    expectContains(*scrollInfo.get(), root->id(), scrollDelta2);
+    expectClearedScrollDeltasRecursive(root.get());
 
-    CCLayerTreeHostCommon::applyScrollAndScale(m_hostImpl->rootLayer(), *scrollInfo);
     root->scrollBy(IntSize());
     scrollInfo = m_hostImpl->processScrollDeltas();
-    ASSERT_EQ(root->scrollPosition(), scrollPosition);
+    ASSERT_EQ(root->scrollPosition(), scrollPosition + scrollDelta + scrollDelta2);
     ASSERT_EQ(scrollInfo->scrolls.size(), 0u);
     expectClearedScrollDeltasRecursive(root.get());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to