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 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 template <typename Function> | 129 template <typename Function> |
130 static void CallFunctionForEveryLayer(LayerTreeImpl* layer, | 130 static void CallFunctionForEveryLayer(LayerTreeImpl* layer, |
131 const Function& function); | 131 const Function& function); |
132 | 132 |
133 struct CC_EXPORT ScrollUpdateInfo { | 133 struct CC_EXPORT ScrollUpdateInfo { |
134 int layer_id; | 134 int layer_id; |
135 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports | 135 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports |
136 // franctional scroll offset. | 136 // franctional scroll offset. |
137 gfx::Vector2d scroll_delta; | 137 gfx::Vector2d scroll_delta; |
138 | 138 |
| 139 ScrollUpdateInfo(); |
| 140 |
139 bool operator==(const ScrollUpdateInfo& other) const; | 141 bool operator==(const ScrollUpdateInfo& other) const; |
140 | 142 |
141 void ToProtobuf(proto::ScrollUpdateInfo* proto) const; | 143 void ToProtobuf(proto::ScrollUpdateInfo* proto) const; |
142 void FromProtobuf(const proto::ScrollUpdateInfo& proto); | 144 void FromProtobuf(const proto::ScrollUpdateInfo& proto); |
143 }; | 145 }; |
144 }; | 146 }; |
145 | 147 |
146 struct CC_EXPORT ScrollAndScaleSet { | 148 struct CC_EXPORT ScrollAndScaleSet { |
147 ScrollAndScaleSet(); | 149 ScrollAndScaleSet(); |
148 ~ScrollAndScaleSet(); | 150 ~ScrollAndScaleSet(); |
149 | 151 |
| 152 // The inner viewport scroll delta is kept separate since it's special. |
| 153 // Because the inner (visual) viewport's maximum offset depends on the |
| 154 // current page scale, the two must be committed at the same time to prevent |
| 155 // clamping. |
| 156 LayerTreeHostCommon::ScrollUpdateInfo inner_viewport_scroll; |
| 157 |
150 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; | 158 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; |
151 float page_scale_delta; | 159 float page_scale_delta; |
152 gfx::Vector2dF elastic_overscroll_delta; | 160 gfx::Vector2dF elastic_overscroll_delta; |
153 float top_controls_delta; | 161 float top_controls_delta; |
154 std::vector<std::unique_ptr<SwapPromise>> swap_promises; | 162 std::vector<std::unique_ptr<SwapPromise>> swap_promises; |
155 | 163 |
156 bool EqualsForTesting(const ScrollAndScaleSet& other) const; | 164 bool EqualsForTesting(const ScrollAndScaleSet& other) const; |
157 void ToProtobuf(proto::ScrollAndScaleSet* proto) const; | 165 void ToProtobuf(proto::ScrollAndScaleSet* proto) const; |
158 void FromProtobuf(const proto::ScrollAndScaleSet& proto); | 166 void FromProtobuf(const proto::ScrollAndScaleSet& proto); |
159 | 167 |
(...skipping 27 matching lines...) Expand all Loading... |
187 function(tree_impl->LayerById(id)); | 195 function(tree_impl->LayerById(id)); |
188 } | 196 } |
189 } | 197 } |
190 | 198 |
191 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); | 199 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); |
192 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); | 200 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); |
193 | 201 |
194 } // namespace cc | 202 } // namespace cc |
195 | 203 |
196 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 204 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
OLD | NEW |