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

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

Issue 1231453002: Compute if a layer is clipped outside CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: is_clipped moved from draw_properties to layer Created 5 years, 5 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_host_common_unittest.cc ('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 "cc/trees/property_tree_builder.h" 5 #include "cc/trees/property_tree_builder.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 data_for_children->render_target->transform_tree_index(); 138 data_for_children->render_target->transform_tree_index();
139 node.owner_id = layer->id(); 139 node.owner_id = layer->id();
140 140
141 data_for_children->clip_tree_parent = 141 data_for_children->clip_tree_parent =
142 data_for_children->clip_tree->Insert(node, parent_id); 142 data_for_children->clip_tree->Insert(node, parent_id);
143 } 143 }
144 144
145 layer->SetClipTreeIndex( 145 layer->SetClipTreeIndex(
146 has_unclipped_surface ? 0 : data_for_children->clip_tree_parent); 146 has_unclipped_surface ? 0 : data_for_children->clip_tree_parent);
147 147
148 // TODO(jaydasika): This value depends on whether a layer has a render
149 // surface or not. When building property trees becomes independant of
150 // render surfaces(see http://crbug.com/504467), this should move.
Ian Vollick 2015/07/07 19:09:39 Hey, I wanted to mention here what we'd discussed
jaydasika 2015/07/07 19:15:56 If render surfaces are determined before building
151 layer->set_is_clipped_from_property_tree(
152 data_for_children->ancestor_clips_subtree);
153
148 // TODO(awoloszyn): Right now when we hit a node with a replica, we reset the 154 // TODO(awoloszyn): Right now when we hit a node with a replica, we reset the
149 // clip for all children since we may need to draw. We need to figure out a 155 // clip for all children since we may need to draw. We need to figure out a
150 // better way, since we will need both the clipped and unclipped versions. 156 // better way, since we will need both the clipped and unclipped versions.
151 } 157 }
152 158
153 template <typename LayerType> 159 template <typename LayerType>
154 bool AddTransformNodeIfNeeded( 160 bool AddTransformNodeIfNeeded(
155 const DataForRecursion<LayerType>& data_from_ancestor, 161 const DataForRecursion<LayerType>& data_from_ancestor,
156 LayerType* layer, 162 LayerType* layer,
157 DataForRecursion<LayerType>* data_for_children) { 163 DataForRecursion<LayerType>* data_for_children) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 const gfx::Rect& viewport, 503 const gfx::Rect& viewport,
498 const gfx::Transform& device_transform, 504 const gfx::Transform& device_transform,
499 PropertyTrees* property_trees) { 505 PropertyTrees* property_trees) {
500 BuildPropertyTreesTopLevelInternal( 506 BuildPropertyTreesTopLevelInternal(
501 root_layer, page_scale_layer, inner_viewport_scroll_layer, 507 root_layer, page_scale_layer, inner_viewport_scroll_layer,
502 outer_viewport_scroll_layer, page_scale_factor, device_scale_factor, 508 outer_viewport_scroll_layer, page_scale_factor, device_scale_factor,
503 viewport, device_transform, property_trees); 509 viewport, device_transform, property_trees);
504 } 510 }
505 511
506 } // namespace cc 512 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698