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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 647753004: Don't set sent_top_controls_delta when root layer doesn't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused variable in unit test Created 6 years, 2 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/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index a10d46b423c1e77b354494db0706179ec91ceea2..91ff5587bb6314ace51e01bc35bd6d392d19d995 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2904,8 +2904,7 @@ void LayerTreeHostImpl::PinchGestureEnd() {
static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
LayerImpl* layer_impl) {
- if (!layer_impl)
- return;
+ DCHECK(layer_impl);
gfx::Vector2d scroll_delta =
gfx::ToFlooredVector2d(layer_impl->ScrollDelta());
@@ -2924,12 +2923,15 @@ static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
- CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
- scroll_info->page_scale_delta = active_tree_->page_scale_delta();
- active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta);
- scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_);
- scroll_info->top_controls_delta = active_tree()->top_controls_delta();
- active_tree_->set_sent_top_controls_delta(scroll_info->top_controls_delta);
+ if (active_tree_->root_layer()) {
+ CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
+ scroll_info->page_scale_delta = active_tree_->page_scale_delta();
+ active_tree_->set_sent_page_scale_delta(scroll_info->page_scale_delta);
+ scroll_info->swap_promises.swap(
+ swap_promises_for_main_thread_scroll_update_);
+ scroll_info->top_controls_delta = active_tree()->top_controls_delta();
+ active_tree_->set_sent_top_controls_delta(scroll_info->top_controls_delta);
+ }
return scroll_info.Pass();
}
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698