[chromium] Apply sent deltas on finishCommit
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 21:00:29 +0000 (21:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2011 21:00:29 +0000 (21:00 +0000)
commit8fadfbffda4871321e6869661834b1fa00ac0735
tree644356984ca28e5c3251104546c1ad449abf2621
parent1d9cafc041c99e73cc9d25f740f4a935a195c3e1
[chromium] Apply sent deltas on finishCommit
https://bugs.webkit.org/show_bug.cgi?id=73884

Patch by Alexandre Elias <aelias@google.com> on 2011-12-06
Reviewed by James Robinson.

This moves scroll and pageScale "sent" deltas to be applied to
the layer at the end of the commit, instead of the beginning.

This has several advantages, especially for page scale:
- When pageScale changes, no longer any need to change the scroll's
coordinate space at beginning of commit, which is complex and prone to
bugs (this fixes a problem where we were forgetting to modify the
scrollPosition before).
- No need for non-commit-related code to consider the "sent" values.
m_pageScale is now always the content scale factor, and
m_pageScaleDelta is the scale to be on the impl-side matrix.
- This will make it easy to send arbitrary fake or future delta
values for example while pinch zooming out.

The scroll logic is similarly altered for consistency's sake.  Note that
I also moved the tree synchronize to the beginning of finishCommit
in order to avoid having to change the pageScale coordinate space of
sentScrollDelta in adjustScrollsForPageScaleChange().

Source/WebCore:

No new tests. (Refactoring of existing code.)

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::pushPropertiesTo):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setPageScaleFactorAndLimits):
(WebCore::CCLayerTreeHostImpl::applyPageScaleDeltaToScrollLayer):
(WebCore::CCLayerTreeHostImpl::processScrollDeltas):

Source/WebKit/chromium:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp