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

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: Whitespace 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
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 3790 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 return task_runner_provider_->HasImplThread(); 3924 return task_runner_provider_->HasImplThread();
3925 } 3925 }
3926 3926
3927 bool LayerTreeHostImpl::CommitToActiveTree() const { 3927 bool LayerTreeHostImpl::CommitToActiveTree() const {
3928 // In single threaded mode we skip the pending tree and commit directly to the 3928 // In single threaded mode we skip the pending tree and commit directly to the
3929 // active tree. 3929 // active tree.
3930 return !task_runner_provider_->HasImplThread(); 3930 return !task_runner_provider_->HasImplThread();
3931 } 3931 }
3932 3932
3933 } // namespace cc 3933 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698