Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: cc/layer_tree_host.cc

Issue 12082012: Implement desktop compatibility viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aelias
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host.cc
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index 9386699d42d4b2aa84fb560332e621d5c45565aa..e7375566129356531e581ba8385835b79195bd0f 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -311,6 +311,14 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
hostImpl->setDebugState(m_debugState);
hostImpl->savePaintTime(m_renderingStats.totalPaintTime);
+ if (LayerImpl* rootScrollLayer = syncTree->RootScrollLayer()) {
+ fprintf (stderr, "debug: %d %d\n", rootScrollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDelta().x(), rootScrollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDelta().y());
+ // FIXME FIXME FIXME
+ rootScrollLayer->setDesktopCompatibilityViewportOffsetFromScrollPosition(rootScrollLayer->desktopCompatibilityViewportOffsetFromScrollPosition() + rootScrollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDelta());
+ rootScrollLayer->setDesktopCompatibilityViewportOffsetFromScrollPositionDelta(rootScrollLayer->desktopCompatibilityViewportOffsetFromScrollPositionDelta() - rootScrollLayer->sentDesktopCompatibilityViewportOffsetFromScrollPositionDelta());
+ rootScrollLayer->setSentDesktopCompatibilityViewportOffsetFromScrollPositionDelta(gfx::Vector2d());
+ }
+
if (newImplTreeHasNoEvictedResources) {
if (syncTree->ContentsTexturesPurged())
syncTree->ResetContentsTexturesPurged();
@@ -748,8 +756,8 @@ void LayerTreeHost::applyScrollAndScale(const ScrollAndScaleSet& info)
else
layer->setScrollOffset(layer->scrollOffset() + info.scrolls[i].scrollDelta);
}
- if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1)
- m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta);
+ if (!rootScrollDelta.IsZero() || info.pageScaleDelta != 1 || !info.desktopCompatibilityViewportOffsetFromScrollPositionDelta.IsZero())
+ m_client->applyScrollAndScale(rootScrollDelta, info.pageScaleDelta, info.desktopCompatibilityViewportOffsetFromScrollPositionDelta);
}
void LayerTreeHost::setImplTransform(const gfx::Transform& transform)
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698