[chromium] Track separate scroll deltas on the compositor thread
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Oct 2011 03:15:10 +0000 (03:15 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Oct 2011 03:15:10 +0000 (03:15 +0000)
commit52c20b19964cdb167f888951a79efa492dcbb476
tree78cb3a118c68d7d89a2e26d44c93f9a30c652f75
parentb50bc081d389848edab6877b2a0c66b15eef7b88
[chromium] Track separate scroll deltas on the compositor thread
https://bugs.webkit.org/show_bug.cgi?id=69034

Reviewed by James Robinson.

Source/WebCore:

Test: new tests in CCLayerTreeHostImplTest/CCLayerTreeHostTest

Track scroll deltas and maximum scrolls on LayerChromium/CCLayerImpl.
The CCLayerImpl tree is now able to adjust these scroll deltas
independent of the main thread. To push them back to the main thread,
CCLayerTreeHostImpl collects them all and then bakes them into the
scroll position during a begin frame and commit call. This allows new
deltas to be collected while the scroll position containing the old
delta and the old scroll position will be overwritten during the next
commit.

Only the main frame is supported right now for pushing this scroll
delta back into the authoritative WebKit source to keep both sides in
sync.

Move tilingTransform() to the impl tree because drawTransform() is now
updated using scroll deltas and so the results from calculating draw
transforms needs to be dynamic so that children are updated properly.

Also, exposed DebugScopedSetImplThread public because it's used in a
few places.

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::pushPropertiesTo):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::maxScrollPosition):
(WebCore::LayerChromium::setMaxScrollPosition):
(WebCore::LayerChromium::scrollDelta):
(WebCore::LayerChromium::scrollable):
* platform/graphics/chromium/NonCompositedContentHost.cpp:
(WebCore::NonCompositedContentHost::setViewport):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::pushPropertiesTo):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::scrollBy):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::maxScrollPosition):
(WebCore::CCLayerImpl::setMaxScrollPosition):
(WebCore::CCLayerImpl::scrollDelta):
(WebCore::CCLayerImpl::setScrollDelta):
(WebCore::CCLayerImpl::scrollable):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::applyScrollDeltas):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsAndVisibilityInternal):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.h:
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::scrollRootLayer):
(WebCore::CCLayerTreeHostImpl::processScrollDeltas):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
* platform/graphics/chromium/cc/CCProxy.h:
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::start):
(WebCore::CCSingleThreadProxy::context):
(WebCore::CCSingleThreadProxy::finishAllRendering):
(WebCore::CCSingleThreadProxy::initializeLayerRenderer):
(WebCore::CCSingleThreadProxy::setNeedsCommit):
(WebCore::CCSingleThreadProxy::stop):
(WebCore::CCSingleThreadProxy::recreateContextIfNeeded):
(WebCore::CCSingleThreadProxy::commitIfNeeded):
(WebCore::CCSingleThreadProxy::doComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(WebCore::DebugScopedSetImplThread::DebugScopedSetImplThread):
(WebCore::DebugScopedSetImplThread::~DebugScopedSetImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread):
(WebCore::CCThreadProxy::beginFrameAndCommit):
* platform/graphics/chromium/cc/CCThreadProxy.h:
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::tilingTransform):
(WebCore::CCTiledLayerImpl::draw):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:

Source/WebKit/chromium:

Add testing support for scroll deltas on layers.

* WebKit.gypi:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::applyScrollDelta):
* src/WebViewImpl.h:
* tests/CCLayerTreeHostImplTest.cpp: Added.
(WebCore::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest):
(WebCore::CCLayerTreeHostImplTest::expectClearedScrollDeltasRecursive):
(WebCore::CCLayerTreeHostImplTest::expectContains):
(WebCore::TEST_F):
* tests/CCLayerTreeHostTest.cpp:
(WTF::TestHooks::applyScrollDelta):
(WTF::MockLayerTreeHostClient::applyScrollDelta):
(WTF::CCLayerTreeHostTest::runTest):
(WTF::CCLayerTreeHostTest::doBeginTest):
(WTF::CCLayerTreeHostTestThreadOnly::runTest):
(WTF::CCLayerTreeHostTestScrollSimple::CCLayerTreeHostTestScrollSimple):
(WTF::CCLayerTreeHostTestScrollSimple::beginTest):
(WTF::CCLayerTreeHostTestScrollSimple::beginCommitOnCCThread):
(WTF::CCLayerTreeHostTestScrollSimple::drawLayersOnCCThread):
(WTF::CCLayerTreeHostTestScrollSimple::applyScrollDelta):
(WTF::CCLayerTreeHostTestScrollSimple::afterTest):
(WTF::TEST_F):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::CCLayerTreeHostTestScrollMultipleRedraw):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::beginTest):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::beginCommitOnCCThread):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::drawLayersOnCCThread):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::applyScrollDelta):
(WTF::CCLayerTreeHostTestScrollMultipleRedraw::afterTest):
* tests/TreeSynchronizerTest.cpp:
(WebCore::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/NonCompositedContentHost.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp [new file with mode: 0644]
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp