| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 } | 639 } |
| 640 layer->render_surface()->SetNearestOcclusionImmuneAncestor( | 640 layer->render_surface()->SetNearestOcclusionImmuneAncestor( |
| 641 nearest_occlusion_immune_ancestor); | 641 nearest_occlusion_immune_ancestor); |
| 642 layer->ClearRenderSurfaceLayerList(); | 642 layer->ClearRenderSurfaceLayerList(); |
| 643 | 643 |
| 644 render_surface_layer_list->push_back(layer); | 644 render_surface_layer_list->push_back(layer); |
| 645 | 645 |
| 646 descendants = &(layer->render_surface()->layer_list()); | 646 descendants = &(layer->render_surface()->layer_list()); |
| 647 } | 647 } |
| 648 | 648 |
| 649 size_t descendants_size = descendants->size(); | |
| 650 | |
| 651 bool layer_should_be_skipped = !draw_property_utils::LayerNeedsUpdate( | 649 bool layer_should_be_skipped = !draw_property_utils::LayerNeedsUpdate( |
| 652 layer, layer_is_drawn, property_trees->transform_tree); | 650 layer, layer_is_drawn, property_trees->transform_tree); |
| 653 if (!layer_should_be_skipped) { | 651 if (!layer_should_be_skipped) { |
| 654 MarkLayerWithRenderSurfaceLayerListId(layer, | 652 MarkLayerWithRenderSurfaceLayerListId(layer, |
| 655 current_render_surface_layer_list_id); | 653 current_render_surface_layer_list_id); |
| 656 descendants->push_back(layer); | 654 descendants->push_back(layer); |
| 657 } | 655 } |
| 658 | 656 |
| 659 | 657 |
| 660 // Clear the old accumulated content rect of surface. | 658 // Clear the old accumulated content rect of surface. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } else { | 722 } else { |
| 725 // The root layer's surface content rect is always the entire viewport. | 723 // The root layer's surface content rect is always the entire viewport. |
| 726 gfx::Rect viewport = | 724 gfx::Rect viewport = |
| 727 gfx::ToEnclosingRect(property_trees->clip_tree.ViewportClip()); | 725 gfx::ToEnclosingRect(property_trees->clip_tree.ViewportClip()); |
| 728 layer->render_surface()->SetContentRect(viewport); | 726 layer->render_surface()->SetContentRect(viewport); |
| 729 } | 727 } |
| 730 | 728 |
| 731 if (render_to_separate_surface && !IsRootLayer(layer) && | 729 if (render_to_separate_surface && !IsRootLayer(layer) && |
| 732 layer->render_surface()->DrawableContentRect().IsEmpty()) { | 730 layer->render_surface()->DrawableContentRect().IsEmpty()) { |
| 733 RemoveSurfaceForEarlyExit(layer, render_surface_layer_list); | 731 RemoveSurfaceForEarlyExit(layer, render_surface_layer_list); |
| 734 return; | |
| 735 } | |
| 736 | |
| 737 // If neither this layer nor any of its children were added, early out. | |
| 738 if (descendants_size == descendants->size()) { | |
| 739 DCHECK(!render_to_separate_surface || IsRootLayer(layer)); | |
| 740 return; | |
| 741 } | 732 } |
| 742 } | 733 } |
| 743 | 734 |
| 744 static void ComputeMaskLayerDrawProperties(const LayerImpl* layer, | 735 static void ComputeMaskLayerDrawProperties(const LayerImpl* layer, |
| 745 LayerImpl* mask_layer) { | 736 LayerImpl* mask_layer) { |
| 746 DrawProperties& mask_layer_draw_properties = mask_layer->draw_properties(); | 737 DrawProperties& mask_layer_draw_properties = mask_layer->draw_properties(); |
| 747 mask_layer_draw_properties.visible_layer_rect = gfx::Rect(layer->bounds()); | 738 mask_layer_draw_properties.visible_layer_rect = gfx::Rect(layer->bounds()); |
| 748 mask_layer_draw_properties.target_space_transform = | 739 mask_layer_draw_properties.target_space_transform = |
| 749 layer->draw_properties().target_space_transform; | 740 layer->draw_properties().target_space_transform; |
| 750 mask_layer_draw_properties.screen_space_transform = | 741 mask_layer_draw_properties.screen_space_transform = |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 942 |
| 952 PropertyTrees* GetPropertyTrees(Layer* layer) { | 943 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 953 return layer->layer_tree_host()->property_trees(); | 944 return layer->layer_tree_host()->property_trees(); |
| 954 } | 945 } |
| 955 | 946 |
| 956 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 947 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 957 return layer->layer_tree_impl()->property_trees(); | 948 return layer->layer_tree_impl()->property_trees(); |
| 958 } | 949 } |
| 959 | 950 |
| 960 } // namespace cc | 951 } // namespace cc |
| OLD | NEW |