OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |