| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/containers/adapters.h" | 11 #include "base/containers/adapters.h" |
| 12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 13 #include "cc/base/math_util.h" | 13 #include "cc/base/math_util.h" |
| 14 #include "cc/layers/heads_up_display_layer_impl.h" | 14 #include "cc/layers/heads_up_display_layer_impl.h" |
| 15 #include "cc/layers/layer.h" | 15 #include "cc/layers/layer.h" |
| 16 #include "cc/layers/layer_impl.h" | 16 #include "cc/layers/layer_impl.h" |
| 17 #include "cc/trees/draw_property_utils.h" | 17 #include "cc/trees/draw_property_utils.h" |
| 18 #include "cc/trees/effect_node.h" | 18 #include "cc/trees/effect_node.h" |
| 19 #include "cc/trees/layer_tree_host.h" | 19 #include "cc/trees/layer_tree_host.h" |
| 20 #include "cc/trees/layer_tree_impl.h" | 20 #include "cc/trees/layer_tree_impl.h" |
| 21 #include "cc/trees/property_tree_builder.h" | 21 #include "cc/trees/property_tree_builder.h" |
| 22 #include "cc/trees/scroll_node.h" | 22 #include "cc/trees/scroll_node.h" |
| 23 #include "cc/trees/transform_node.h" |
| 23 #include "ui/gfx/geometry/rect_conversions.h" | 24 #include "ui/gfx/geometry/rect_conversions.h" |
| 24 #include "ui/gfx/geometry/vector2d_conversions.h" | 25 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 25 #include "ui/gfx/transform.h" | 26 #include "ui/gfx/transform.h" |
| 26 #include "ui/gfx/transform_util.h" | 27 #include "ui/gfx/transform_util.h" |
| 27 | 28 |
| 28 namespace cc { | 29 namespace cc { |
| 29 | 30 |
| 30 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting:: | 31 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting:: |
| 31 CalcDrawPropsMainInputsForTesting(Layer* root_layer, | 32 CalcDrawPropsMainInputsForTesting(Layer* root_layer, |
| 32 const gfx::Size& device_viewport_size, | 33 const gfx::Size& device_viewport_size, |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // add their content rect to their target surface's accumulated content rect. | 288 // add their content rect to their target surface's accumulated content rect. |
| 288 for (LayerImpl* layer : *layer_tree_impl) { | 289 for (LayerImpl* layer : *layer_tree_impl) { |
| 289 RenderSurfaceImpl* render_surface = layer->GetRenderSurface(); | 290 RenderSurfaceImpl* render_surface = layer->GetRenderSurface(); |
| 290 if (render_surface) { | 291 if (render_surface) { |
| 291 render_surface->ClearLayerLists(); | 292 render_surface->ClearLayerLists(); |
| 292 ClearMaskLayersAreDrawnRenderSurfaceLayerListMembers(render_surface); | 293 ClearMaskLayersAreDrawnRenderSurfaceLayerListMembers(render_surface); |
| 293 } | 294 } |
| 294 layer->set_is_drawn_render_surface_layer_list_member(false); | 295 layer->set_is_drawn_render_surface_layer_list_member(false); |
| 295 | 296 |
| 296 bool is_root = layer_tree_impl->IsRootLayer(layer); | 297 bool is_root = layer_tree_impl->IsRootLayer(layer); |
| 297 bool skip_layer = !is_root && draw_property_utils::LayerShouldBeSkipped( | 298 |
| 298 layer, property_trees->transform_tree, | 299 bool skip_draw_properties_computation = |
| 299 property_trees->effect_tree); | 300 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( |
| 301 layer, property_trees->transform_tree, property_trees->effect_tree); |
| 302 |
| 303 const TransformNode* transform_node = |
| 304 property_trees->transform_tree.Node(layer->transform_tree_index()); |
| 305 bool skip_for_invertibility = !transform_node->ancestors_are_invertible; |
| 306 |
| 307 bool skip_layer = !is_root && (skip_draw_properties_computation || |
| 308 skip_for_invertibility); |
| 309 |
| 310 layer->set_raster_even_if_not_in_rsll(skip_for_invertibility && |
| 311 !skip_draw_properties_computation); |
| 300 if (skip_layer) | 312 if (skip_layer) |
| 301 continue; | 313 continue; |
| 302 | 314 |
| 303 bool render_to_separate_surface = | 315 bool render_to_separate_surface = |
| 304 is_root || (can_render_to_separate_surface && render_surface); | 316 is_root || (can_render_to_separate_surface && render_surface); |
| 305 | 317 |
| 306 if (render_to_separate_surface) { | 318 if (render_to_separate_surface) { |
| 307 DCHECK(render_surface); | 319 DCHECK(render_surface); |
| 308 DCHECK(layer->render_target() == render_surface); | 320 DCHECK(layer->render_target() == render_surface); |
| 309 render_surface->ClearAccumulatedContentRect(); | 321 render_surface->ClearAccumulatedContentRect(); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 647 |
| 636 PropertyTrees* GetPropertyTrees(Layer* layer) { | 648 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 637 return layer->layer_tree_host()->property_trees(); | 649 return layer->layer_tree_host()->property_trees(); |
| 638 } | 650 } |
| 639 | 651 |
| 640 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 652 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 641 return layer->layer_tree_impl()->property_trees(); | 653 return layer->layer_tree_impl()->property_trees(); |
| 642 } | 654 } |
| 643 | 655 |
| 644 } // namespace cc | 656 } // namespace cc |
| OLD | NEW |