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

Unified Diff: cc/layers/layer_impl.cc

Issue 2053193002: cc : Move LayerImpl::children to test properties (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.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index ed6218de99cdf095edb19e5cbd1a1767c9513e73..14d72ca3b735fbb6e5dd9d1076e47b4b06fecc0e 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -109,20 +109,20 @@ LayerImpl::~LayerImpl() {
DCHECK(!layer_tree_impl_->RemoveLayer(mask_layer_id_));
if (replica_layer_)
DCHECK(!layer_tree_impl_->RemoveLayer(replica_layer_id_));
- children_.clear();
}
void LayerImpl::AddChild(std::unique_ptr<LayerImpl> child) {
child->SetParent(this);
DCHECK_EQ(layer_tree_impl(), child->layer_tree_impl());
- children_.push_back(child.get());
+ test_properties()->children.push_back(child.get());
layer_tree_impl_->AddLayer(std::move(child));
}
ajuma 2016/06/09 23:39:47 AddChild and RemoveChild should also (eventually)
jaydasika 2016/06/10 02:13:39 Acknowledged.
std::unique_ptr<LayerImpl> LayerImpl::RemoveChildForTesting(LayerImpl* child) {
- auto it = std::find(children_.begin(), children_.end(), child);
- if (it != children_.end())
- children_.erase(it);
+ auto it = std::find(test_properties()->children.begin(),
+ test_properties()->children.end(), child);
+ if (it != test_properties()->children.end())
+ test_properties()->children.erase(it);
layer_tree_impl()->property_trees()->RemoveIdFromIdToIndexMaps(child->id());
return layer_tree_impl_->RemoveLayer(child->id());
}
@@ -132,7 +132,6 @@ void LayerImpl::SetParent(LayerImpl* parent) {
}
void LayerImpl::ClearLinksToOtherLayers() {
- children_.clear();
mask_layer_ = nullptr;
replica_layer_ = nullptr;
}
@@ -433,7 +432,7 @@ gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const {
return scroll_clip_layer->bounds_delta();
}
-std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() const {
+std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() {
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue);
result->SetInteger("LayerId", id());
result->SetString("LayerType", LayerTypeAsString());
@@ -470,8 +469,8 @@ std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() const {
}
list = new base::ListValue;
- for (size_t i = 0; i < children_.size(); ++i)
- list->Append(children_[i]->LayerTreeAsJson());
+ for (size_t i = 0; i < test_properties()->children.size(); ++i)
+ list->Append(test_properties()->children[i]->LayerTreeAsJson());
result->Set("Children", list);
return result;
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698