| Index: cc/trees/layer_tree_host.cc
|
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
|
| index fc99e9e92229c86a9cdddb3ce16ed3cc11387ed8..bf8b1458c76894ce232b0301937f032b998d6035 100644
|
| --- a/cc/trees/layer_tree_host.cc
|
| +++ b/cc/trees/layer_tree_host.cc
|
| @@ -106,7 +106,7 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
|
| num_failed_recreate_attempts_(0),
|
| settings_(settings),
|
| debug_state_(settings.initial_debug_state),
|
| - top_controls_layout_height_(0.f),
|
| + top_controls_content_offset_(0.f),
|
| device_scale_factor_(1.f),
|
| visible_(true),
|
| page_scale_factor_(1.f),
|
| @@ -347,11 +347,16 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
|
|
|
| sync_tree->PassSwapPromises(&swap_promise_list_);
|
|
|
| + sync_tree->set_top_controls_content_offset(top_controls_content_offset_);
|
| + sync_tree->set_top_controls_delta(
|
| + sync_tree->top_controls_delta() -
|
| + sync_tree->sent_top_controls_delta());
|
| + sync_tree->set_sent_top_controls_delta(0.f);
|
| +
|
| host_impl->SetUseGpuRasterization(UseGpuRasterization());
|
| RecordGpuRasterizationHistogram();
|
|
|
| host_impl->SetViewportSize(device_viewport_size_);
|
| - host_impl->SetTopControlsLayoutHeight(top_controls_layout_height_);
|
| host_impl->SetDeviceScaleFactor(device_scale_factor_);
|
| host_impl->SetDebugState(debug_state_);
|
| if (pending_page_scale_animation_) {
|
| @@ -627,12 +632,11 @@ void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) {
|
| SetNeedsCommit();
|
| }
|
|
|
| -void LayerTreeHost::SetTopControlsLayoutHeight(
|
| - float top_controls_layout_height) {
|
| - if (top_controls_layout_height_ == top_controls_layout_height)
|
| +void LayerTreeHost::SetTopControlsContentOffset(float offset) {
|
| + if (top_controls_content_offset_ == offset)
|
| return;
|
|
|
| - top_controls_layout_height_ = top_controls_layout_height;
|
| + top_controls_content_offset_ = offset;
|
| SetNeedsCommit();
|
| }
|
|
|
| @@ -1072,7 +1076,9 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
|
| }
|
|
|
| if (!inner_viewport_scroll_delta.IsZero() ||
|
| - !outer_viewport_scroll_delta.IsZero() || info->page_scale_delta != 1.f) {
|
| + !outer_viewport_scroll_delta.IsZero() ||
|
| + info->page_scale_delta != 1.f ||
|
| + info->top_controls_content_offset != top_controls_content_offset_) {
|
| // SetScrollOffsetFromImplSide above could have destroyed the tree,
|
| // so re-get this layer before doing anything to it.
|
|
|
| @@ -1081,6 +1087,10 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
|
| // value, then the layer can early out without needing a full commit.
|
| DCHECK(inner_viewport_scroll_layer_.get()); // We should always have this.
|
|
|
| + // TODO(bokan): Fold this call into the client_->ApplyScrollAndScale call
|
| + // below once single viewport pinch is removed.
|
| + client_->SetTopControlsContentOffset(info->top_controls_content_offset);
|
| +
|
| inner_viewport_scroll_layer_->SetScrollOffsetFromImplSide(
|
| inner_viewport_scroll_layer_->scroll_offset() +
|
| inner_viewport_scroll_delta);
|
|
|