diff options
author | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 12:10:51 +0000 |
---|---|---|
committer | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 12:10:51 +0000 |
commit | c602794770e4839ebbc8b5829a23d182a23b25f8 (patch) | |
tree | 86009ef7b0ffbbf0fdf604312ee0d57eede45d37 /cc/layer_tree_host.cc | |
parent | f1533031bc950c6ac62721034da0a9470ad8c2ae (diff) | |
download | chromium_src-c602794770e4839ebbc8b5829a23d182a23b25f8.zip chromium_src-c602794770e4839ebbc8b5829a23d182a23b25f8.tar.gz chromium_src-c602794770e4839ebbc8b5829a23d182a23b25f8.tar.bz2 |
Move page scale ownership to LayerTreeImpl.
Page scale is conceptually very similar to scroll offset, just
multiplicative instead of additive. It has the exact same problems of
state synchronization between WebKit and the CC impl thread, and the
solution is also the same. In this patch I closely imitated the three-way
sentScrollDelta logic. I also deleted PinchZoomViewport and moved
everything to LayerTreeImpl because it turned out there was almost no
logic that could be isolated there.
This resolves many graphical glitches, including the white flashes and
blurriness while pinching or double-tap zooming, and the jumping around
during navigation.
NOTRY=true
BUG=171914
Review URL: https://chromiumcodereview.appspot.com/12093015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179607 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host.cc')
-rw-r--r-- | cc/layer_tree_host.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc index 9386699..a6e2a76 100644 --- a/cc/layer_tree_host.cc +++ b/cc/layer_tree_host.cc @@ -299,6 +299,23 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl) syncTree->FindRootScrollLayer(); + float page_scale_delta, sent_page_scale_delta; + if (m_settings.implSidePainting) { + // Update the delta from the active tree, which may have + // adjusted its delta prior to the pending tree being created. + // This code is equivalent to that in LayerTreeImpl::SetPageScaleDelta. + DCHECK_EQ(1, syncTree->sent_page_scale_delta()); + page_scale_delta = hostImpl->activeTree()->page_scale_delta(); + sent_page_scale_delta = hostImpl->activeTree()->sent_page_scale_delta(); + } else { + page_scale_delta = syncTree->page_scale_delta(); + sent_page_scale_delta = syncTree->sent_page_scale_delta(); + syncTree->set_sent_page_scale_delta(1); + } + + syncTree->SetPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor); + syncTree->SetPageScaleDelta(page_scale_delta / sent_page_scale_delta); + if (!m_settings.implSidePainting) { // If we're not in impl-side painting, the tree is immediately // considered active. @@ -307,7 +324,6 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl) hostImpl->setViewportSize(layoutViewportSize(), deviceViewportSize()); hostImpl->setDeviceScaleFactor(deviceScaleFactor()); - hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor); hostImpl->setDebugState(m_debugState); hostImpl->savePaintTime(m_renderingStats.totalPaintTime); |