| 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 |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 MarkLayerWithRenderSurfaceLayerListId(layer, | 817 MarkLayerWithRenderSurfaceLayerListId(layer, |
| 818 current_render_surface_layer_list_id); | 818 current_render_surface_layer_list_id); |
| 819 descendants->push_back(layer); | 819 descendants->push_back(layer); |
| 820 } | 820 } |
| 821 | 821 |
| 822 | 822 |
| 823 // Clear the old accumulated content rect of surface. | 823 // Clear the old accumulated content rect of surface. |
| 824 if (render_to_separate_surface) | 824 if (render_to_separate_surface) |
| 825 layer->render_surface()->SetAccumulatedContentRect(gfx::Rect()); | 825 layer->render_surface()->SetAccumulatedContentRect(gfx::Rect()); |
| 826 | 826 |
| 827 for (const auto& child_layer : layer->children()) { | 827 for (auto* child_layer : layer->children()) { |
| 828 CalculateRenderSurfaceLayerList( | 828 CalculateRenderSurfaceLayerList( |
| 829 child_layer.get(), property_trees, render_surface_layer_list, | 829 child_layer, property_trees, render_surface_layer_list, descendants, |
| 830 descendants, nearest_occlusion_immune_ancestor, layer_is_drawn, | 830 nearest_occlusion_immune_ancestor, layer_is_drawn, |
| 831 can_render_to_separate_surface, current_render_surface_layer_list_id, | 831 can_render_to_separate_surface, current_render_surface_layer_list_id, |
| 832 max_texture_size); | 832 max_texture_size); |
| 833 | 833 |
| 834 // If the child is its own render target, then it has a render surface. | 834 // If the child is its own render target, then it has a render surface. |
| 835 if (child_layer->render_target() == child_layer.get() && | 835 if (child_layer->render_target() == child_layer && |
| 836 !child_layer->render_surface()->layer_list().empty() && | 836 !child_layer->render_surface()->layer_list().empty() && |
| 837 !child_layer->render_surface()->content_rect().IsEmpty()) { | 837 !child_layer->render_surface()->content_rect().IsEmpty()) { |
| 838 // This child will contribute its render surface, which means | 838 // This child will contribute its render surface, which means |
| 839 // we need to mark just the mask layer (and replica mask layer) | 839 // we need to mark just the mask layer (and replica mask layer) |
| 840 // with the id. | 840 // with the id. |
| 841 MarkMasksWithRenderSurfaceLayerListId( | 841 MarkMasksWithRenderSurfaceLayerListId( |
| 842 child_layer.get(), current_render_surface_layer_list_id); | 842 child_layer, current_render_surface_layer_list_id); |
| 843 descendants->push_back(child_layer.get()); | 843 descendants->push_back(child_layer); |
| 844 } | 844 } |
| 845 | 845 |
| 846 if (child_layer->layer_or_descendant_is_drawn()) { | 846 if (child_layer->layer_or_descendant_is_drawn()) { |
| 847 bool layer_or_descendant_is_drawn = true; | 847 bool layer_or_descendant_is_drawn = true; |
| 848 layer->set_layer_or_descendant_is_drawn(layer_or_descendant_is_drawn); | 848 layer->set_layer_or_descendant_is_drawn(layer_or_descendant_is_drawn); |
| 849 } | 849 } |
| 850 } | 850 } |
| 851 | 851 |
| 852 if (render_to_separate_surface && !IsRootLayer(layer) && | 852 if (render_to_separate_surface && !IsRootLayer(layer) && |
| 853 layer->render_surface()->layer_list().empty()) { | 853 layer->render_surface()->layer_list().empty()) { |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 | 1118 |
| 1119 PropertyTrees* GetPropertyTrees(Layer* layer) { | 1119 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 1120 return layer->layer_tree_host()->property_trees(); | 1120 return layer->layer_tree_host()->property_trees(); |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 1123 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 1124 return layer->layer_tree_impl()->property_trees(); | 1124 return layer->layer_tree_impl()->property_trees(); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 } // namespace cc | 1127 } // namespace cc |
| OLD | NEW |