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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |