| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 settings().minimum_occlusion_tracking_size); | 854 settings().minimum_occlusion_tracking_size); |
| 855 | 855 |
| 856 // LayerIterator is used here instead of CallFunctionForSubtree to only | 856 // LayerIterator is used here instead of CallFunctionForSubtree to only |
| 857 // UpdateTilePriorities on layers that will be visible (and thus have valid | 857 // UpdateTilePriorities on layers that will be visible (and thus have valid |
| 858 // draw properties) and not because any ordering is required. | 858 // draw properties) and not because any ordering is required. |
| 859 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); | 859 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); |
| 860 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); | 860 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); |
| 861 it != end; ++it) { | 861 it != end; ++it) { |
| 862 occlusion_tracker.EnterLayer(it); | 862 occlusion_tracker.EnterLayer(it); |
| 863 | 863 |
| 864 // There are very few render targets so this should be cheap to do for | 864 bool inside_replica = it->render_target()->InsideReplica(); |
| 865 // each layer instead of something more complicated. | |
| 866 bool inside_replica = false; | |
| 867 LayerImpl* layer = it->render_target(); | |
| 868 while (layer && !inside_replica) { | |
| 869 if (layer->render_target()->has_replica()) | |
| 870 inside_replica = true; | |
| 871 layer = layer->render_target()->parent(); | |
| 872 } | |
| 873 | 865 |
| 874 // Don't use occlusion if a layer will appear in a replica, since the | 866 // Don't use occlusion if a layer will appear in a replica, since the |
| 875 // tile raster code does not know how to look for the replica and would | 867 // tile raster code does not know how to look for the replica and would |
| 876 // consider it occluded even though the replica is visible. | 868 // consider it occluded even though the replica is visible. |
| 877 // Since occlusion is only used for browser compositor (i.e. | 869 // Since occlusion is only used for browser compositor (i.e. |
| 878 // use_occlusion_for_tile_prioritization) and it won't use replicas, | 870 // use_occlusion_for_tile_prioritization) and it won't use replicas, |
| 879 // this should matter not. | 871 // this should matter not. |
| 880 | 872 |
| 881 if (it.represents_itself()) { | 873 if (it.represents_itself()) { |
| 882 Occlusion occlusion = | 874 Occlusion occlusion = |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 } | 2098 } |
| 2107 | 2099 |
| 2108 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { | 2100 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { |
| 2109 layers_that_should_push_properties_.clear(); | 2101 layers_that_should_push_properties_.clear(); |
| 2110 for (auto* layer : *this) | 2102 for (auto* layer : *this) |
| 2111 layer->ResetChangeTracking(); | 2103 layer->ResetChangeTracking(); |
| 2112 property_trees_.ResetAllChangeTracking(flag); | 2104 property_trees_.ResetAllChangeTracking(flag); |
| 2113 } | 2105 } |
| 2114 | 2106 |
| 2115 } // namespace cc | 2107 } // namespace cc |
| OLD | NEW |