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

Unified Diff: cc/layers/effect_tree_layer_list_iterator.cc

Issue 2814273003: cc: Make DamageTracker use the effect tree and layer list (Closed)
Patch Set: Rebase Created 3 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 | « no previous file | cc/trees/damage_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/effect_tree_layer_list_iterator.cc
diff --git a/cc/layers/effect_tree_layer_list_iterator.cc b/cc/layers/effect_tree_layer_list_iterator.cc
index a5228dcb85174694de51f21029ae30508bd9e1a5..72c14d3e8f81bf7f09178f87c4de489b30bc00cb 100644
--- a/cc/layers/effect_tree_layer_list_iterator.cc
+++ b/cc/layers/effect_tree_layer_list_iterator.cc
@@ -43,20 +43,6 @@ EffectTreeLayerListIterator::EffectTreeLayerListIterator(
EffectTreeLayerListIterator::~EffectTreeLayerListIterator() {}
-// Finds the lowest common ancestor that has a render surface.
-static int LowestCommonAncestor(int effect_id_1,
- int effect_id_2,
- const EffectTree* effect_tree) {
- while (effect_id_1 != effect_id_2) {
- if (effect_id_1 < effect_id_2)
- effect_id_2 = effect_tree->Node(effect_id_2)->target_id;
- else
- effect_id_1 = effect_tree->Node(effect_id_1)->target_id;
- }
-
- return effect_id_1;
-}
-
void EffectTreeLayerListIterator::operator++() {
switch (state_) {
case State::LAYER:
@@ -80,8 +66,9 @@ void EffectTreeLayerListIterator::operator++() {
// If the next drawn layer has a different target effect tree index, check
// for surfaces whose contributors have all been visited.
if (next_effect_tree_index_ != current_effect_tree_index_) {
- lowest_common_effect_tree_ancestor_index_ = LowestCommonAncestor(
- current_effect_tree_index_, next_effect_tree_index_, effect_tree_);
+ lowest_common_effect_tree_ancestor_index_ =
+ effect_tree_->LowestCommonAncestorWithRenderSurface(
+ current_effect_tree_index_, next_effect_tree_index_);
// If the current layer's target effect node is an ancestor of the next
// layer's target effect node, then the current effect node still has
// more contributors that need to be visited. Otherwise, all
« no previous file with comments | « no previous file | cc/trees/damage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698