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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 714003002: Allow changing top controls height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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_impl.h ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index ad355fa977b0cc0168c28f8c21defcba7784263c..2405af10060e7ef2bbbd966f263cec3cb1aa47dc 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -96,7 +96,8 @@ LayerTreeImpl::LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl)
next_activation_forces_redraw_(false),
has_ever_been_drawn_(false),
render_surface_layer_list_id_(0),
- top_controls_layout_height_(0),
+ top_controls_shrink_blink_size_(false),
+ top_controls_height_(0),
top_controls_content_offset_(0),
top_controls_delta_(0),
sent_top_controls_delta_(0) {
@@ -209,11 +210,19 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
target_tree->PassSwapPromises(&swap_promise_list_);
- target_tree->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 =
+ target_tree->top_controls_height_ - top_controls_height_;
+
+ target_tree->top_controls_shrink_blink_size_ =
+ top_controls_shrink_blink_size_;
+ target_tree->top_controls_height_ = top_controls_height_;
target_tree->top_controls_content_offset_ = top_controls_content_offset_;
- target_tree->top_controls_delta_ =
- target_tree->top_controls_delta_ -
- target_tree->sent_top_controls_delta_;
+ target_tree->top_controls_delta_ = target_tree->top_controls_delta_ -
+ target_tree->sent_top_controls_delta_ -
+ top_controls_height_delta;
target_tree->sent_top_controls_delta_ = 0.f;
target_tree->SetPageScaleValues(
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698