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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 2087963003: cc: Stop creating unused 0 property tree nodes other than transform Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 71d8e6be0a6626f00b14320fadb73cd0f29cbe5b..2787dbf5af3307f2d2dd925886b042c181175597 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -298,7 +298,8 @@ enum PropertyTreeOption {
static void ComputeLayerScrollsDrawnDescendants(LayerTreeImpl* layer_tree_impl,
ScrollTree* scroll_tree) {
- for (int i = static_cast<int>(scroll_tree->size()) - 1; i > 0; --i) {
+ for (int i = static_cast<int>(scroll_tree->size()) - 1;
+ i > ScrollTree::kRootNodeId; --i) {
ScrollNode* node = scroll_tree->Node(i);
scroll_tree->parent(node)->data.num_drawn_descendants +=
node->data.num_drawn_descendants;
@@ -320,7 +321,8 @@ static void ComputeInitialRenderSurfaceLayerList(
LayerImplList* render_surface_layer_list,
bool can_render_to_separate_surface) {
ScrollTree* scroll_tree = &property_trees->scroll_tree;
- for (int i = 0; i < static_cast<int>(scroll_tree->size()); ++i)
+ for (int i = ScrollTree::kRootNodeId;
+ i < static_cast<int>(scroll_tree->size()); ++i)
scroll_tree->Node(i)->data.num_drawn_descendants = 0;
// Add all non-skipped surfaces to the initial render surface layer list. Add

Powered by Google App Engine
This is Rietveld 408576698