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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 783543003: Update from https://crrev.com/306901 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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_perftest.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 6c7cfe0e915b2b8e445b81a1f5fc59b8feb42612..361fae14285e58f5675126d4a16d9b1338a79e11 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -117,7 +117,8 @@ LayerTreeHost::LayerTreeHost(
num_failed_recreate_attempts_(0),
settings_(settings),
debug_state_(settings.initial_debug_state),
- top_controls_layout_height_(0.f),
+ top_controls_shrink_blink_size_(false),
+ top_controls_height_(0.f),
top_controls_content_offset_(0.f),
device_scale_factor_(1.f),
visible_(true),
@@ -360,20 +361,24 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
sync_tree->RegisterSelection(selection_start_, selection_end_);
- float page_scale_delta =
- sync_tree->page_scale_delta() / sync_tree->sent_page_scale_delta();
- sync_tree->SetPageScaleValues(page_scale_factor_,
- min_page_scale_factor_,
- max_page_scale_factor_,
- page_scale_delta);
- sync_tree->set_sent_page_scale_delta(1.f);
+ sync_tree->PushPageScaleFromMainThread(
+ page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_);
sync_tree->PassSwapPromises(&swap_promise_list_);
- sync_tree->set_top_controls_layout_height(top_controls_layout_height_);
+ // 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());
+ sync_tree->sent_top_controls_delta() -
+ top_controls_height_delta);
sync_tree->set_sent_top_controls_delta(0.f);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
@@ -673,11 +678,19 @@ void LayerTreeHost::SetViewportSize(const gfx::Size& device_viewport_size) {
SetNeedsCommit();
}
-void LayerTreeHost::SetTopControlsLayoutHeight(float height) {
- if (top_controls_layout_height_ == height)
+void LayerTreeHost::SetTopControlsShrinkBlinkSize(bool shrink) {
+ if (top_controls_shrink_blink_size_ == shrink)
+ return;
+
+ top_controls_shrink_blink_size_ = shrink;
+ SetNeedsCommit();
+}
+
+void LayerTreeHost::SetTopControlsHeight(float height) {
+ if (top_controls_height_ == height)
return;
- top_controls_layout_height_ = height;
+ top_controls_height_ = height;
SetNeedsCommit();
}
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698