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

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: Build fix after rebase Created 4 years, 7 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_view_impl.h » ('j') | no next file with comments »
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 inner_->ClampScrollToMaxScrollOffset(); 117 inner_->ClampScrollToMaxScrollOffset();
118 outer_->ClampScrollToMaxScrollOffset(); 118 outer_->ClampScrollToMaxScrollOffset();
119 119
120 gfx::ScrollOffset viewport_location = 120 gfx::ScrollOffset viewport_location =
121 inner_->CurrentScrollOffset() + outer_->CurrentScrollOffset(); 121 inner_->CurrentScrollOffset() + outer_->CurrentScrollOffset();
122 122
123 gfx::Vector2dF delta = 123 gfx::Vector2dF delta =
124 viewport_in_content_coordinates_.DeltaFrom(viewport_location); 124 viewport_in_content_coordinates_.DeltaFrom(viewport_location);
125 125
126 delta = outer_->ScrollBy(delta); 126 delta = inner_->ScrollBy(delta);
127 inner_->ScrollBy(delta); 127 outer_->ScrollBy(delta);
128 } 128 }
129 129
130 private: 130 private:
131 LayerImpl* inner_; 131 LayerImpl* inner_;
132 LayerImpl* outer_; 132 LayerImpl* outer_;
133 gfx::ScrollOffset viewport_in_content_coordinates_; 133 gfx::ScrollOffset viewport_in_content_coordinates_;
134 }; 134 };
135 135
136 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) { 136 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) {
137 if (visible) { 137 if (visible) {
(...skipping 3805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3943 return task_runner_provider_->HasImplThread(); 3943 return task_runner_provider_->HasImplThread();
3944 } 3944 }
3945 3945
3946 bool LayerTreeHostImpl::CommitToActiveTree() const { 3946 bool LayerTreeHostImpl::CommitToActiveTree() const {
3947 // In single threaded mode we skip the pending tree and commit directly to the 3947 // In single threaded mode we skip the pending tree and commit directly to the
3948 // active tree. 3948 // active tree.
3949 return !task_runner_provider_->HasImplThread(); 3949 return !task_runner_provider_->HasImplThread();
3950 } 3950 }
3951 3951
3952 } // namespace cc 3952 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698