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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 585063002: Made double-tap zoom work in pinch virtual viewport mode (Chromium-side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another build fix Created 6 years, 3 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/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index eed1e5a7e151e74942e0b78d54b96f38a2f2874d..38795bb3c1698f8565bd0b53014cf347508d58ff 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1091,11 +1091,11 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
// SetScrollOffsetFromImplSide above could have destroyed the tree,
// so re-get this layer before doing anything to it.
+ DCHECK(inner_viewport_scroll_layer_.get()); // We should always have this.
+
// Preemptively apply the scroll offset and scale delta here before sending
// it to the client. If the client comes back and sets it to the same
// value, then the layer can early out without needing a full commit.
- DCHECK(inner_viewport_scroll_layer_.get()); // We should always have this.
-
inner_viewport_scroll_layer_->SetScrollOffsetFromImplSide(
inner_viewport_scroll_layer_->scroll_offset() +
inner_viewport_scroll_delta);
@@ -1104,12 +1104,20 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
outer_viewport_scroll_layer_->scroll_offset() +
outer_viewport_scroll_delta);
}
- ApplyPageScaleDeltaFromImplSide(info->page_scale_delta);
- client_->ApplyViewportDeltas(
- inner_viewport_scroll_delta + outer_viewport_scroll_delta,
- info->page_scale_delta,
- info->top_controls_delta);
+ ApplyPageScaleDeltaFromImplSide(info->page_scale_delta);
+ if (!outer_viewport_scroll_layer_.get()) {
+ client_->ApplyViewportDeltas(
+ inner_viewport_scroll_delta + outer_viewport_scroll_delta,
+ info->page_scale_delta,
+ info->top_controls_delta);
+ } else {
+ client_->ApplyViewportDeltas(
+ inner_viewport_scroll_delta,
+ outer_viewport_scroll_delta,
+ info->page_scale_delta,
+ info->top_controls_delta);
+ }
}
}
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698