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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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.h ('k') | cc/trees/layer_tree_host_common.cc » ('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 fa4dd5dc544dcc7a491947148d9c99a40a74927d..f4780789394c447a1b3a56cfb5925ef325dec6a1 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -119,7 +119,7 @@ LayerTreeHost::LayerTreeHost(
debug_state_(settings.initial_debug_state),
top_controls_shrink_blink_size_(false),
top_controls_height_(0.f),
- top_controls_content_offset_(0.f),
+ top_controls_shown_ratio_(0.f),
device_scale_factor_(1.f),
visible_(true),
page_scale_factor_(1.f),
@@ -335,20 +335,10 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->PassSwapPromises(&swap_promise_list_);
- // Track the change in top controls height to offset the top_controls_delta
- // properly. This is so that the top controls offset will be maintained
- // across height changes.
- float top_controls_height_delta =
- sync_tree->top_controls_height() - top_controls_height_;
-
sync_tree->set_top_controls_shrink_blink_size(
top_controls_shrink_blink_size_);
sync_tree->set_top_controls_height(top_controls_height_);
- 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() -
- top_controls_height_delta);
- sync_tree->set_sent_top_controls_delta(0.f);
+ sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
host_impl->set_gpu_rasterization_status(GetGpuRasterizationStatus());
@@ -691,11 +681,11 @@ void LayerTreeHost::SetTopControlsHeight(float height) {
SetNeedsCommit();
}
-void LayerTreeHost::SetTopControlsContentOffset(float offset) {
- if (top_controls_content_offset_ == offset)
+void LayerTreeHost::SetTopControlsShownRatio(float ratio) {
+ if (top_controls_shown_ratio_ == ratio)
return;
- top_controls_content_offset_ = offset;
+ top_controls_shown_ratio_ = ratio;
SetNeedsCommit();
}
@@ -1229,7 +1219,7 @@ void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints,
animate));
}
-void LayerTreeHost::AsValueInto(base::debug::TracedValue* state) const {
+void LayerTreeHost::AsValueInto(base::trace_event::TracedValue* state) const {
state->BeginDictionary("proxy");
proxy_->AsValueInto(state);
state->EndDictionary();
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698