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

Side by Side 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: Recover CallFunctionForEveryLayer 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/draw_property_utils.h" 5 #include "cc/trees/draw_property_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 const TransformTree& transform_tree, 413 const TransformTree& transform_tree,
414 const EffectTree& effect_tree) { 414 const EffectTree& effect_tree) {
415 return LayerShouldBeSkippedInternal(layer, layer_is_drawn, transform_tree, 415 return LayerShouldBeSkippedInternal(layer, layer_is_drawn, transform_tree,
416 effect_tree); 416 effect_tree);
417 } 417 }
418 418
419 void FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host, 419 void FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host,
420 const TransformTree& transform_tree, 420 const TransformTree& transform_tree,
421 const EffectTree& effect_tree, 421 const EffectTree& effect_tree,
422 LayerList* update_layer_list) { 422 LayerList* update_layer_list) {
423 LayerTreeHostCommon::CallFunctionForEveryLayer( 423 for (auto* layer : *layer_tree_host) {
424 layer_tree_host, 424 bool layer_is_drawn =
425 [&](Layer* layer) { 425 effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
426 bool layer_is_drawn =
427 effect_tree.Node(layer->effect_tree_index())->data.is_drawn;
428 426
429 if (!IsRootLayer(layer) && 427 if (!IsRootLayer(layer) &&
430 LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree, 428 LayerShouldBeSkipped(layer, layer_is_drawn, transform_tree,
431 effect_tree)) 429 effect_tree))
Ian Vollick 2016/04/23 00:50:24 I believe that this should be a continue, not a re
432 return; 430 return;
433 431
434 if (LayerNeedsUpdate(layer, layer_is_drawn, transform_tree)) { 432 if (LayerNeedsUpdate(layer, layer_is_drawn, transform_tree)) {
435 update_layer_list->push_back(layer); 433 update_layer_list->push_back(layer);
436 } 434 }
437 435
438 // Append mask layers to the update layer list. They don't have valid 436 // Append mask layers to the update layer list. They don't have valid
439 // visible rects, so need to get added after the above calculation. 437 // visible rects, so need to get added after the above calculation.
440 // Replica layers don't need to be updated. 438 // Replica layers don't need to be updated.
441 if (Layer* mask_layer = layer->mask_layer()) 439 if (Layer* mask_layer = layer->mask_layer())
442 update_layer_list->push_back(mask_layer); 440 update_layer_list->push_back(mask_layer);
443 if (Layer* replica_layer = layer->replica_layer()) { 441 if (Layer* replica_layer = layer->replica_layer()) {
444 if (Layer* mask_layer = replica_layer->mask_layer()) 442 if (Layer* mask_layer = replica_layer->mask_layer())
445 update_layer_list->push_back(mask_layer); 443 update_layer_list->push_back(mask_layer);
446 } 444 }
447 }, 445 }
448 CallFunctionLayerType::BASIC_LAYER);
449 } 446 }
450 447
451 static void ResetIfHasNanCoordinate(gfx::RectF* rect) { 448 static void ResetIfHasNanCoordinate(gfx::RectF* rect) {
452 if (std::isnan(rect->x()) || std::isnan(rect->y()) || 449 if (std::isnan(rect->x()) || std::isnan(rect->y()) ||
453 std::isnan(rect->right()) || std::isnan(rect->bottom())) 450 std::isnan(rect->right()) || std::isnan(rect->bottom()))
454 *rect = gfx::RectF(); 451 *rect = gfx::RectF();
455 } 452 }
456 453
457 void ComputeClips(ClipTree* clip_tree, 454 void ComputeClips(ClipTree* clip_tree,
458 const TransformTree& transform_tree, 455 const TransformTree& transform_tree,
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1120 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1124 const Layer* overscroll_elasticity_layer, 1121 const Layer* overscroll_elasticity_layer,
1125 const gfx::Vector2dF& elastic_overscroll) { 1122 const gfx::Vector2dF& elastic_overscroll) {
1126 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1123 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1127 elastic_overscroll); 1124 elastic_overscroll);
1128 } 1125 }
1129 1126
1130 } // namespace draw_property_utils 1127 } // namespace draw_property_utils
1131 1128
1132 } // namespace cc 1129 } // namespace cc
OLDNEW
« 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