| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "cc/base/cc_export.h" | 16 #include "cc/base/cc_export.h" |
| 17 #include "cc/layers/layer_lists.h" | 17 #include "cc/layers/layer_collections.h" |
| 18 #include "cc/trees/property_tree.h" | 18 #include "cc/trees/property_tree.h" |
| 19 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 20 #include "ui/gfx/geometry/vector2d.h" | 20 #include "ui/gfx/geometry/vector2d.h" |
| 21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 namespace proto { | 25 namespace proto { |
| 26 class ScrollUpdateInfo; | 26 class ScrollUpdateInfo; |
| 27 class ScrollAndScaleSet; | 27 class ScrollAndScaleSet; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Returns a layer with the given id if one exists in the subtree starting | 139 // Returns a layer with the given id if one exists in the subtree starting |
| 140 // from the given root layer (including mask and replica layers). | 140 // from the given root layer (including mask and replica layers). |
| 141 template <typename LayerType> | 141 template <typename LayerType> |
| 142 static LayerType* FindLayerInSubtree(LayerType* root_layer, int layer_id); | 142 static LayerType* FindLayerInSubtree(LayerType* root_layer, int layer_id); |
| 143 | 143 |
| 144 static Layer* get_layer_as_raw_ptr(const LayerList& layers, size_t index) { | 144 static Layer* get_layer_as_raw_ptr(const LayerList& layers, size_t index) { |
| 145 return layers[index].get(); | 145 return layers[index].get(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 static LayerImpl* get_layer_as_raw_ptr(const OwnedLayerImplList& layers, | |
| 149 size_t index) { | |
| 150 return layers[index].get(); | |
| 151 } | |
| 152 | |
| 153 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, | 148 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, |
| 154 size_t index) { | 149 size_t index) { |
| 155 return layers[index]; | 150 return layers[index]; |
| 156 } | 151 } |
| 157 | 152 |
| 158 struct CC_EXPORT ScrollUpdateInfo { | 153 struct CC_EXPORT ScrollUpdateInfo { |
| 159 int layer_id; | 154 int layer_id; |
| 160 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports | 155 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports |
| 161 // franctional scroll offset. | 156 // franctional scroll offset. |
| 162 gfx::Vector2d scroll_delta; | 157 gfx::Vector2d scroll_delta; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 function); | 240 function); |
| 246 } | 241 } |
| 247 } | 242 } |
| 248 | 243 |
| 249 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); | 244 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); |
| 250 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); | 245 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); |
| 251 | 246 |
| 252 } // namespace cc | 247 } // namespace cc |
| 253 | 248 |
| 254 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 249 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
| OLD | NEW |