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

Unified Diff: cc/trees/damage_tracker_unittest.cc

Issue 1909283004: cc: Remove LayerImpl::children() calls after tree synchronization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_position_constraint_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/damage_tracker_unittest.cc
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
index e276c01f3ed770995d67c2a967e9155a9f769c8c..11190770b81121afd6d1afc8bb97dc6fa94c9408 100644
--- a/cc/trees/damage_tracker_unittest.cc
+++ b/cc/trees/damage_tracker_unittest.cc
@@ -42,13 +42,11 @@ void ExecuteCalculateDrawProperties(LayerImpl* root,
ASSERT_TRUE(root->render_surface());
}
-void ClearDamageForAllSurfaces(LayerImpl* layer) {
- if (layer->render_surface())
- layer->render_surface()->damage_tracker()->DidDrawDamagedArea();
-
- // Recursively clear damage for any existing surface.
- for (size_t i = 0; i < layer->children().size(); ++i)
- ClearDamageForAllSurfaces(layer->children()[i]);
+void ClearDamageForAllSurfaces(LayerImpl* root) {
+ for (auto* layer : *root->layer_tree_impl()) {
+ if (layer->render_surface())
+ layer->render_surface()->damage_tracker()->DidDrawDamagedArea();
+ }
}
void EmulateDrawingOneFrame(LayerImpl* root) {
« no previous file with comments | « cc/layers/layer_position_constraint_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698