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

Unified Diff: cc/layers/layer_impl_test_properties.cc

Issue 2084233002: cc: Move LayerImpl::AddChild and RemoveChild to LayerImplTestProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/layers/layer_impl_test_properties.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl_test_properties.cc
diff --git a/cc/layers/layer_impl_test_properties.cc b/cc/layers/layer_impl_test_properties.cc
index dd2e26885af3c3207ba7998cd9ada2a64af8f94d..e3e0fd60f61ebae8847114e27abb76284a94ba5b 100644
--- a/cc/layers/layer_impl_test_properties.cc
+++ b/cc/layers/layer_impl_test_properties.cc
@@ -29,6 +29,22 @@ LayerImplTestProperties::LayerImplTestProperties(LayerImpl* owning_layer)
LayerImplTestProperties::~LayerImplTestProperties() {}
+void LayerImplTestProperties::AddChild(std::unique_ptr<LayerImpl> child) {
+ child->test_properties()->parent = owning_layer;
+ children.push_back(child.get());
+ owning_layer->layer_tree_impl()->AddLayer(std::move(child));
+}
+
+std::unique_ptr<LayerImpl> LayerImplTestProperties::RemoveChild(
+ LayerImpl* child) {
+ auto it = std::find(children.begin(), children.end(), child);
+ if (it != children.end())
+ children.erase(it);
+ owning_layer->layer_tree_impl()->property_trees()->RemoveIdFromIdToIndexMaps(
+ child->id());
+ return owning_layer->layer_tree_impl()->RemoveLayer(child->id());
+}
+
void LayerImplTestProperties::SetMaskLayer(std::unique_ptr<LayerImpl> mask) {
if (mask_layer)
owning_layer->layer_tree_impl()->RemoveLayer(mask_layer->id());
« no previous file with comments | « cc/layers/layer_impl_test_properties.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698