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

Unified Diff: cc/trees/layer_tree_impl.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_unittest_video.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index b6776ceab0a1e5fddb7930719d3efcfeca754a60..ce681465574c7dd778935e1719d5c8e4c2bd3626 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -130,9 +130,10 @@ class CC_EXPORT LayerTreeImpl {
// Other public methods
// ---------------------------------------------------------------------------
- LayerImpl* root_layer() const { return root_layer_.get(); }
+ LayerImpl* root_layer() const { return root_layer_; }
void SetRootLayer(scoped_ptr<LayerImpl>);
- scoped_ptr<LayerImpl> DetachLayerTree();
+ scoped_ptr<OwnedLayerImplList> DetachLayers();
+ void ClearLayers();
void SetPropertyTrees(const PropertyTrees property_trees) {
property_trees_ = property_trees;
@@ -307,6 +308,10 @@ class CC_EXPORT LayerTreeImpl {
void RegisterLayer(LayerImpl* layer);
void UnregisterLayer(LayerImpl* layer);
+ // These manage ownership of the LayerImpl.
+ void AddLayer(scoped_ptr<LayerImpl> layer);
+ scoped_ptr<LayerImpl> RemoveLayer(int id);
+
size_t NumLayers();
void DidBecomeActive();
@@ -496,7 +501,7 @@ class CC_EXPORT LayerTreeImpl {
LayerTreeHostImpl* layer_tree_host_impl_;
int source_frame_number_;
int is_first_frame_after_commit_tracker_;
- scoped_ptr<LayerImpl> root_layer_;
+ LayerImpl* root_layer_;
HeadsUpDisplayLayerImpl* hud_layer_;
PropertyTrees property_trees_;
SkColor background_color_;
@@ -519,8 +524,8 @@ class CC_EXPORT LayerTreeImpl {
scoped_refptr<SyncedElasticOverscroll> elastic_overscroll_;
- using LayerIdMap = std::unordered_map<int, LayerImpl*>;
- LayerIdMap layer_id_map_;
+ scoped_ptr<OwnedLayerImplList> layers_;
+ LayerImplMap layer_id_map_;
// Set of layers that need to push properties.
std::unordered_set<LayerImpl*> layers_that_should_push_properties_;
« no previous file with comments | « cc/trees/layer_tree_host_unittest_video.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698