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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2051013002: cc : Push layer lists instead of layer tree at commit and activation (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/trees/layer_tree_impl.h ('k') | cc/trees/tree_synchronizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 901bba6175af8ffa1d92ac9e1d84987840ffa00d..e39989515e1f56a5daf69755eee8a6368689320e 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -261,11 +261,24 @@ void LayerTreeImpl::SetRootLayer(std::unique_ptr<LayerImpl> layer) {
layer_tree_host_impl_->OnCanDrawStateChangedForTree();
}
-void LayerTreeImpl::BuildLayerListForTesting() {
+void LayerTreeImpl::SetRootLayerFromLayerList() {
+ root_layer_ = layer_list_.empty() ? nullptr : layer_list_[0];
+ layer_tree_host_impl_->OnCanDrawStateChangedForTree();
+}
+
+void LayerTreeImpl::AddToLayerList(LayerImpl* layer) {
+ layer_list_.push_back(layer);
+}
+
+void LayerTreeImpl::ClearLayerList() {
layer_list_.clear();
+}
+
+void LayerTreeImpl::BuildLayerListForTesting() {
+ ClearLayerList();
LayerListIterator<LayerImpl> it(root_layer_);
for (; it != LayerListIterator<LayerImpl>(nullptr); ++it) {
- layer_list_.push_back(*it);
+ AddToLayerList(*it);
}
}
@@ -307,6 +320,7 @@ gfx::ScrollOffset LayerTreeImpl::TotalMaxScrollOffset() const {
std::unique_ptr<OwnedLayerImplList> LayerTreeImpl::DetachLayers() {
root_layer_ = nullptr;
+ layer_list_.clear();
render_surface_layer_list_.clear();
set_needs_update_draw_properties();
std::unique_ptr<OwnedLayerImplList> ret = std::move(layers_);
@@ -444,20 +458,20 @@ void LayerTreeImpl::MoveChangeTrackingToLayers() {
}
}
-LayerListIterator<LayerImpl> LayerTreeImpl::begin() const {
- return LayerListIterator<LayerImpl>(root_layer_);
+LayerImplList::const_iterator LayerTreeImpl::begin() const {
+ return layer_list_.cbegin();
}
-LayerListIterator<LayerImpl> LayerTreeImpl::end() const {
- return LayerListIterator<LayerImpl>(nullptr);
+LayerImplList::const_iterator LayerTreeImpl::end() const {
+ return layer_list_.cend();
}
-LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() {
- return LayerListReverseIterator<LayerImpl>(root_layer_);
+LayerImplList::reverse_iterator LayerTreeImpl::rbegin() {
+ return layer_list_.rbegin();
}
-LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() {
- return LayerListReverseIterator<LayerImpl>(nullptr);
+LayerImplList::reverse_iterator LayerTreeImpl::rend() {
+ return layer_list_.rend();
}
void LayerTreeImpl::AddToElementMap(LayerImpl* layer) {
@@ -1507,7 +1521,7 @@ void LayerTreeImpl::AddSurfaceLayer(LayerImpl* layer) {
}
void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) {
- std::vector<LayerImpl*>::iterator it =
+ LayerImplList::iterator it =
std::find(surface_layers_.begin(), surface_layers_.end(), layer);
DCHECK(it != surface_layers_.end());
surface_layers_.erase(it);
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/tree_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698