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 <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 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2567 current_render_surface_layer_list_id); | 2567 current_render_surface_layer_list_id); |
2568 descendants->push_back(layer); | 2568 descendants->push_back(layer); |
2569 } | 2569 } |
2570 | 2570 |
2571 bool compute_content_rects = verify_property_trees || use_property_trees; | 2571 bool compute_content_rects = verify_property_trees || use_property_trees; |
2572 | 2572 |
2573 // Clear the old accumulated content rect of surface. | 2573 // Clear the old accumulated content rect of surface. |
2574 if (compute_content_rects && render_to_separate_surface) | 2574 if (compute_content_rects && render_to_separate_surface) |
2575 layer->render_surface()->SetAccumulatedContentRect(gfx::Rect()); | 2575 layer->render_surface()->SetAccumulatedContentRect(gfx::Rect()); |
2576 | 2576 |
2577 for (auto& child_layer : layer->children()) { | 2577 for (const scoped_ptr<LayerImpl>& child_layer : layer->children()) { |
danakj
2015/11/17 01:12:19
auto
vmpstr
2015/11/17 23:26:25
Done.
| |
2578 CalculateRenderSurfaceLayerListInternal( | 2578 CalculateRenderSurfaceLayerListInternal( |
2579 child_layer, property_trees, render_surface_layer_list, descendants, | 2579 child_layer.get(), property_trees, render_surface_layer_list, |
2580 nearest_occlusion_immune_ancestor, layer_is_drawn, | 2580 descendants, nearest_occlusion_immune_ancestor, layer_is_drawn, |
2581 can_render_to_separate_surface, current_render_surface_layer_list_id, | 2581 can_render_to_separate_surface, current_render_surface_layer_list_id, |
2582 max_texture_size, verify_property_trees, use_property_trees); | 2582 max_texture_size, verify_property_trees, use_property_trees); |
2583 | 2583 |
2584 // If the child is its own render target, then it has a render surface. | 2584 // If the child is its own render target, then it has a render surface. |
2585 if (child_layer->render_target() == child_layer && | 2585 if (child_layer->render_target() == child_layer && |
2586 !child_layer->render_surface()->layer_list().empty() && | 2586 !child_layer->render_surface()->layer_list().empty() && |
2587 !child_layer->render_surface()->content_rect().IsEmpty()) { | 2587 !child_layer->render_surface()->content_rect().IsEmpty()) { |
2588 // This child will contribute its render surface, which means | 2588 // This child will contribute its render surface, which means |
2589 // we need to mark just the mask layer (and replica mask layer) | 2589 // we need to mark just the mask layer (and replica mask layer) |
2590 // with the id. | 2590 // with the id. |
2591 MarkMasksWithRenderSurfaceLayerListId( | 2591 MarkMasksWithRenderSurfaceLayerListId( |
2592 child_layer, current_render_surface_layer_list_id); | 2592 child_layer.get(), current_render_surface_layer_list_id); |
2593 descendants->push_back(child_layer); | 2593 descendants->push_back(child_layer.get()); |
2594 } | 2594 } |
2595 | 2595 |
2596 if (child_layer->layer_or_descendant_is_drawn()) { | 2596 if (child_layer->layer_or_descendant_is_drawn()) { |
2597 bool layer_or_descendant_is_drawn = true; | 2597 bool layer_or_descendant_is_drawn = true; |
2598 layer->set_layer_or_descendant_is_drawn(layer_or_descendant_is_drawn); | 2598 layer->set_layer_or_descendant_is_drawn(layer_or_descendant_is_drawn); |
2599 } | 2599 } |
2600 } | 2600 } |
2601 | 2601 |
2602 if (render_to_separate_surface && !IsRootLayer(layer) && | 2602 if (render_to_separate_surface && !IsRootLayer(layer) && |
2603 layer->render_surface()->layer_list().empty()) { | 2603 layer->render_surface()->layer_list().empty()) { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2866 | 2866 |
2867 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2867 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2868 return layer->layer_tree_host()->property_trees(); | 2868 return layer->layer_tree_host()->property_trees(); |
2869 } | 2869 } |
2870 | 2870 |
2871 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2871 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2872 return layer->layer_tree_impl()->property_trees(); | 2872 return layer->layer_tree_impl()->property_trees(); |
2873 } | 2873 } |
2874 | 2874 |
2875 } // namespace cc | 2875 } // namespace cc |
OLD | NEW |