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

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

Issue 947613003: Add a sanity check to ensure that CDP doesn't hit a cycle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/DCHECK/CHECK/ Created 5 years, 10 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/draw_properties.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 }; 1204 };
1205 1205
1206 // Recursively walks the layer tree to compute any information that is needed 1206 // Recursively walks the layer tree to compute any information that is needed
1207 // before doing the main recursion. 1207 // before doing the main recursion.
1208 template <typename LayerType> 1208 template <typename LayerType>
1209 static void PreCalculateMetaInformation( 1209 static void PreCalculateMetaInformation(
1210 LayerType* layer, 1210 LayerType* layer,
1211 PreCalculateMetaInformationRecursiveData* recursive_data) { 1211 PreCalculateMetaInformationRecursiveData* recursive_data) {
1212 layer->draw_properties().sorted_for_recursion = false; 1212 layer->draw_properties().sorted_for_recursion = false;
1213 layer->draw_properties().has_child_with_a_scroll_parent = false; 1213 layer->draw_properties().has_child_with_a_scroll_parent = false;
1214 layer->draw_properties().visited = false;
1214 1215
1215 if (!HasInvertibleOrAnimatedTransform(layer)) { 1216 if (!HasInvertibleOrAnimatedTransform(layer)) {
1216 // Layers with singular transforms should not be drawn, the whole subtree 1217 // Layers with singular transforms should not be drawn, the whole subtree
1217 // can be skipped. 1218 // can be skipped.
1218 return; 1219 return;
1219 } 1220 }
1220 1221
1221 if (layer->clip_parent()) 1222 if (layer->clip_parent())
1222 recursive_data->num_unclipped_descendants++; 1223 recursive_data->num_unclipped_descendants++;
1223 1224
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 // The replica draw transform to the root (screen space) origin is: 1572 // The replica draw transform to the root (screen space) origin is:
1572 // M[replica2root] = M[surface2root] * Tr[replica->position()] * 1573 // M[replica2root] = M[surface2root] * Tr[replica->position()] *
1573 // Tr[replica] * Tr[origin2anchor].inverse() 1574 // Tr[replica] * Tr[origin2anchor].inverse()
1574 // 1575 //
1575 1576
1576 // It makes no sense to have a non-unit page_scale_factor without specifying 1577 // It makes no sense to have a non-unit page_scale_factor without specifying
1577 // which layer roots the subtree the scale is applied to. 1578 // which layer roots the subtree the scale is applied to.
1578 DCHECK(globals.page_scale_application_layer || 1579 DCHECK(globals.page_scale_application_layer ||
1579 (globals.page_scale_factor == 1.f)); 1580 (globals.page_scale_factor == 1.f));
1580 1581
1582 CHECK(!layer->draw_properties().visited);
1583 layer->draw_properties().visited = true;
1584
1581 DataForRecursion<LayerType> data_for_children; 1585 DataForRecursion<LayerType> data_for_children;
1582 typename LayerType::RenderSurfaceType* 1586 typename LayerType::RenderSurfaceType*
1583 nearest_occlusion_immune_ancestor_surface = 1587 nearest_occlusion_immune_ancestor_surface =
1584 data_from_ancestor.nearest_occlusion_immune_ancestor_surface; 1588 data_from_ancestor.nearest_occlusion_immune_ancestor_surface;
1585 data_for_children.in_subtree_of_page_scale_application_layer = 1589 data_for_children.in_subtree_of_page_scale_application_layer =
1586 data_from_ancestor.in_subtree_of_page_scale_application_layer; 1590 data_from_ancestor.in_subtree_of_page_scale_application_layer;
1587 data_for_children.subtree_can_use_lcd_text = 1591 data_for_children.subtree_can_use_lcd_text =
1588 data_from_ancestor.subtree_can_use_lcd_text; 1592 data_from_ancestor.subtree_can_use_lcd_text;
1589 1593
1590 // Layers that are marked as hidden will hide themselves and their subtree. 1594 // Layers that are marked as hidden will hide themselves and their subtree.
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 inputs->current_render_surface_layer_list_id); 2562 inputs->current_render_surface_layer_list_id);
2559 2563
2560 // The dummy layer list should not have been used. 2564 // The dummy layer list should not have been used.
2561 DCHECK_EQ(0u, dummy_layer_list.size()); 2565 DCHECK_EQ(0u, dummy_layer_list.size());
2562 // A root layer render_surface should always exist after 2566 // A root layer render_surface should always exist after
2563 // CalculateDrawProperties. 2567 // CalculateDrawProperties.
2564 DCHECK(inputs->root_layer->render_surface()); 2568 DCHECK(inputs->root_layer->render_surface());
2565 } 2569 }
2566 2570
2567 } // namespace cc 2571 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/draw_properties.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698