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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1844013002: Fix main thread top controls scrolling to mirror CC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@propertyTreesBoundsDelta
Patch Set: Override top controls resize() in classes that override resize() Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 inner_->ClampScrollToMaxScrollOffset(); 113 inner_->ClampScrollToMaxScrollOffset();
114 outer_->ClampScrollToMaxScrollOffset(); 114 outer_->ClampScrollToMaxScrollOffset();
115 115
116 gfx::ScrollOffset viewport_location = 116 gfx::ScrollOffset viewport_location =
117 inner_->CurrentScrollOffset() + outer_->CurrentScrollOffset(); 117 inner_->CurrentScrollOffset() + outer_->CurrentScrollOffset();
118 118
119 gfx::Vector2dF delta = 119 gfx::Vector2dF delta =
120 viewport_in_content_coordinates_.DeltaFrom(viewport_location); 120 viewport_in_content_coordinates_.DeltaFrom(viewport_location);
121 121
122 delta = outer_->ScrollBy(delta); 122 delta = inner_->ScrollBy(delta);
123 inner_->ScrollBy(delta); 123 outer_->ScrollBy(delta);
124 } 124 }
125 125
126 private: 126 private:
127 LayerImpl* inner_; 127 LayerImpl* inner_;
128 LayerImpl* outer_; 128 LayerImpl* outer_;
129 gfx::ScrollOffset viewport_in_content_coordinates_; 129 gfx::ScrollOffset viewport_in_content_coordinates_;
130 }; 130 };
131 131
132 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) { 132 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) {
133 if (visible) { 133 if (visible) {
(...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after
3921 return task_runner_provider_->HasImplThread(); 3921 return task_runner_provider_->HasImplThread();
3922 } 3922 }
3923 3923
3924 bool LayerTreeHostImpl::CommitToActiveTree() const { 3924 bool LayerTreeHostImpl::CommitToActiveTree() const {
3925 // In single threaded mode we skip the pending tree and commit directly to the 3925 // In single threaded mode we skip the pending tree and commit directly to the
3926 // active tree. 3926 // active tree.
3927 return !task_runner_provider_->HasImplThread(); 3927 return !task_runner_provider_->HasImplThread();
3928 } 3928 }
3929 3929
3930 } // namespace cc 3930 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget.cc » ('j') | content/renderer/render_widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698