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

Side by Side Diff: cc/trees/layer_tree_host_common.h

Issue 1801853002: Transfer LayerImpl ownership to LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more asan. Created 4 years, 9 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
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698