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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1846043002: cc : Make CallFunctionForSubtree on impl use layer iterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_serialization.cc ('k') | cc/trees/single_thread_proxy.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 21e71ae049ffb0ade90d37e414b52c4d02d20c76..7f56ae4af5f5ce08b2a0918842f0b53d3bd99913 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -105,15 +105,15 @@ void LayerTreeImpl::Shutdown() {
void LayerTreeImpl::ReleaseResources() {
if (root_layer_) {
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer_, [](LayerImpl* layer) { layer->ReleaseResources(); });
+ LayerTreeHostCommon::CallFunctionForEveryLayer(
+ this, [](LayerImpl* layer) { layer->ReleaseResources(); });
}
}
void LayerTreeImpl::RecreateResources() {
if (root_layer_) {
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer_, [](LayerImpl* layer) { layer->RecreateResources(); });
+ LayerTreeHostCommon::CallFunctionForEveryLayer(
+ this, [](LayerImpl* layer) { layer->RecreateResources(); });
}
}
@@ -125,8 +125,8 @@ void LayerTreeImpl::GatherFrameTimingRequestIds(
// TODO(vmpstr): Early out if there are no requests on any of the layers. For
// that, we need to inform LayerTreeImpl whenever there are requests when we
// get them.
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer_, [request_ids](LayerImpl* layer) {
+ LayerTreeHostCommon::CallFunctionForEveryLayer(
+ this, [request_ids](LayerImpl* layer) {
layer->GatherFrameTimingRequestIds(request_ids);
});
}
@@ -564,10 +564,9 @@ void LayerTreeImpl::UpdatePropertyTreeScrollingAndAnimationFromMainThread() {
// frame to a newly-committed property tree.
if (!root_layer())
return;
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(), [](LayerImpl* layer) {
- layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
- });
+ LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) {
+ layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
+ });
}
void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) {
@@ -853,7 +852,7 @@ bool LayerTreeImpl::UpdateDrawProperties(bool update_lcd_text) {
occlusion_tracker.set_minimum_tracking_size(
settings().minimum_occlusion_tracking_size);
- // LayerIterator is used here instead of CallFunctionForSubtree to only
+ // LayerIterator is used here instead of CallFunctionForEveryLayer to only
// UpdateTilePriorities on layers that will be visible (and thus have valid
// draw properties) and not because any ordering is required.
LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
@@ -1077,8 +1076,8 @@ void LayerTreeImpl::DidBecomeActive() {
layer_tree_host_impl_->ResetRequiresHighResToDraw();
if (root_layer()) {
- LayerTreeHostCommon::CallFunctionForSubtree(
- root_layer(), [](LayerImpl* layer) { layer->DidBecomeActive(); });
+ LayerTreeHostCommon::CallFunctionForEveryLayer(
+ this, [](LayerImpl* layer) { layer->DidBecomeActive(); });
}
for (const auto& swap_promise : swap_promise_list_)
« no previous file with comments | « cc/trees/layer_tree_host_unittest_serialization.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698