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

Side by Side Diff: cc/trees/property_tree.cc

Issue 1884613005: cc : Simplify layer skipping logic (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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 if (parent_node) 1237 if (parent_node)
1238 node->data.screen_space_opacity *= parent_node->data.screen_space_opacity; 1238 node->data.screen_space_opacity *= parent_node->data.screen_space_opacity;
1239 } 1239 }
1240 1240
1241 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { 1241 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) {
1242 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. 1242 // Nodes that have screen space opacity 0 are hidden. So they are not drawn.
1243 // Exceptions: 1243 // Exceptions:
1244 // 1) Nodes that contribute to copy requests, whether hidden or not, must be 1244 // 1) Nodes that contribute to copy requests, whether hidden or not, must be
1245 // drawn. 1245 // drawn.
1246 // 2) Nodes that have a background filter. 1246 // 2) Nodes that have a background filter.
1247 // 3) Nodes with animating screen space opacity are drawn if their parent is 1247 // 3) Nodes with animating screen space opacity on main thread or pending tree
1248 // drawn irrespective of their opacity. 1248 // are drawn if their parent is drawn irrespective of their opacity.
1249 if (node->data.has_copy_request) 1249 if (node->data.has_copy_request)
1250 node->data.is_drawn = true; 1250 node->data.is_drawn = true;
1251 else if (node->data.opacity == 0.f && !node->data.has_animated_opacity && 1251 else if (node->data.opacity == 0.f &&
1252 (!node->data.has_animated_opacity || property_trees()->is_active) &&
1252 !node->data.has_background_filters) 1253 !node->data.has_background_filters)
1253 node->data.is_drawn = false; 1254 node->data.is_drawn = false;
1254 else if (parent_node) 1255 else if (parent_node)
1255 node->data.is_drawn = parent_node->data.is_drawn; 1256 node->data.is_drawn = parent_node->data.is_drawn;
1256 else 1257 else
1257 node->data.is_drawn = true; 1258 node->data.is_drawn = true;
1258 } 1259 }
1259 1260
1260 void EffectTree::UpdateEffectChanged(EffectNode* node, 1261 void EffectTree::UpdateEffectChanged(EffectNode* node,
1261 EffectNode* parent_node) { 1262 EffectNode* parent_node) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 } 1322 }
1322 set_needs_update(true); 1323 set_needs_update(true);
1323 } 1324 }
1324 1325
1325 bool EffectTree::ContributesToDrawnSurface(int id) { 1326 bool EffectTree::ContributesToDrawnSurface(int id) {
1326 // All drawn nodes contribute to drawn surface. 1327 // All drawn nodes contribute to drawn surface.
1327 // Exception : Nodes that are hidden and are drawn only for the sake of 1328 // Exception : Nodes that are hidden and are drawn only for the sake of
1328 // copy requests. 1329 // copy requests.
1329 EffectNode* node = Node(id); 1330 EffectNode* node = Node(id);
1330 EffectNode* parent_node = parent(node); 1331 EffectNode* parent_node = parent(node);
1331 bool contributes_to_drawn_surface = 1332 return node->data.is_drawn && (!parent_node || parent_node->data.is_drawn);
1332 node->data.is_drawn &&
1333 (node->data.opacity != 0.f || node->data.has_animated_opacity ||
1334 node->data.has_background_filters);
1335 if (parent_node && !parent_node->data.is_drawn)
1336 contributes_to_drawn_surface = false;
1337 return contributes_to_drawn_surface;
1338 } 1333 }
1339 1334
1340 void EffectTree::ResetChangeTracking() { 1335 void EffectTree::ResetChangeTracking() {
1341 for (int id = 1; id < static_cast<int>(size()); ++id) { 1336 for (int id = 1; id < static_cast<int>(size()); ++id) {
1342 EffectNode* node = Node(id); 1337 EffectNode* node = Node(id);
1343 node->data.effect_changed = false; 1338 node->data.effect_changed = false;
1344 } 1339 }
1345 } 1340 }
1346 1341
1347 void TransformTree::UpdateNodeAndAncestorsHaveIntegerTranslations( 1342 void TransformTree::UpdateNodeAndAncestorsHaveIntegerTranslations(
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 break; 1949 break;
1955 case ALL_TREES: 1950 case ALL_TREES:
1956 transform_tree.ResetChangeTracking(); 1951 transform_tree.ResetChangeTracking();
1957 effect_tree.ResetChangeTracking(); 1952 effect_tree.ResetChangeTracking();
1958 } 1953 }
1959 changed = false; 1954 changed = false;
1960 full_tree_damaged = false; 1955 full_tree_damaged = false;
1961 } 1956 }
1962 1957
1963 } // namespace cc 1958 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698