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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1907053004: cc: Make CallFunctionForEveryLayer use LayerListIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FindLayers should skip layers instead of returning when switching from call-function to iteration l… 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_proto_converter.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index f8fc1181f00ed714c678ccd2ca0db2c2557d0881..35563c73d5def2c90e46c2ad9708cc8d7ed56f71 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -420,32 +420,29 @@ void FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host,
const TransformTree& transform_tree,
const EffectTree& effect_tree,
LayerList* update_layer_list) {
- LayerTreeHostCommon::CallFunctionForEveryLayer(
- layer_tree_host,
- [&](Layer* layer) {
- bool layer_is_drawn =
- effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
-
- if (!IsRootLayer(layer) &&
- LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree,
- effect_tree))
- return;
-
- if (LayerNeedsUpdate(layer, layer_is_drawn, transform_tree)) {
- update_layer_list->push_back(layer);
- }
+ for (auto* layer : *layer_tree_host) {
+ bool layer_is_drawn =
+ effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
- // Append mask layers to the update layer list. They don't have valid
- // visible rects, so need to get added after the above calculation.
- // Replica layers don't need to be updated.
- if (Layer* mask_layer = layer->mask_layer())
- update_layer_list->push_back(mask_layer);
- if (Layer* replica_layer = layer->replica_layer()) {
- if (Layer* mask_layer = replica_layer->mask_layer())
- update_layer_list->push_back(mask_layer);
- }
- },
- CallFunctionLayerType::BASIC_LAYER);
+ if (!IsRootLayer(layer) &&
+ LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree,
+ effect_tree))
+ continue;
+
+ if (LayerNeedsUpdate(layer, layer_is_drawn, transform_tree)) {
+ update_layer_list->push_back(layer);
+ }
+
+ // Append mask layers to the update layer list. They don't have valid
+ // visible rects, so need to get added after the above calculation.
+ // Replica layers don't need to be updated.
+ if (Layer* mask_layer = layer->mask_layer())
+ update_layer_list->push_back(mask_layer);
+ if (Layer* replica_layer = layer->replica_layer()) {
+ if (Layer* mask_layer = replica_layer->mask_layer())
+ update_layer_list->push_back(mask_layer);
+ }
+ }
}
static void ResetIfHasNanCoordinate(gfx::RectF* rect) {
« no previous file with comments | « cc/layers/layer_proto_converter.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698