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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 settings().minimum_occlusion_tracking_size); | 853 settings().minimum_occlusion_tracking_size); |
854 | 854 |
855 // LayerIterator is used here instead of CallFunctionForEveryLayer to only | 855 // LayerIterator is used here instead of CallFunctionForEveryLayer to only |
856 // UpdateTilePriorities on layers that will be visible (and thus have valid | 856 // UpdateTilePriorities on layers that will be visible (and thus have valid |
857 // draw properties) and not because any ordering is required. | 857 // draw properties) and not because any ordering is required. |
858 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); | 858 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); |
859 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); | 859 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); |
860 it != end; ++it) { | 860 it != end; ++it) { |
861 occlusion_tracker.EnterLayer(it); | 861 occlusion_tracker.EnterLayer(it); |
862 | 862 |
863 bool inside_replica = it->render_target()->InsideReplica(); | 863 bool inside_replica = it->InsideReplica(); |
864 | 864 |
865 // Don't use occlusion if a layer will appear in a replica, since the | 865 // Don't use occlusion if a layer will appear in a replica, since the |
866 // tile raster code does not know how to look for the replica and would | 866 // tile raster code does not know how to look for the replica and would |
867 // consider it occluded even though the replica is visible. | 867 // consider it occluded even though the replica is visible. |
868 // Since occlusion is only used for browser compositor (i.e. | 868 // Since occlusion is only used for browser compositor (i.e. |
869 // use_occlusion_for_tile_prioritization) and it won't use replicas, | 869 // use_occlusion_for_tile_prioritization) and it won't use replicas, |
870 // this should matter not. | 870 // this should matter not. |
871 | 871 |
872 if (it.represents_itself()) { | 872 if (it.represents_itself()) { |
873 Occlusion occlusion = | 873 Occlusion occlusion = |
(...skipping 25 matching lines...) Expand all Loading... |
899 if (LayerImpl* replica = it->replica_layer()) { | 899 if (LayerImpl* replica = it->replica_layer()) { |
900 if (LayerImpl* mask = replica->mask_layer()) | 900 if (LayerImpl* mask = replica->mask_layer()) |
901 mask->draw_properties().occlusion_in_content_space = Occlusion(); | 901 mask->draw_properties().occlusion_in_content_space = Occlusion(); |
902 } | 902 } |
903 } | 903 } |
904 | 904 |
905 occlusion_tracker.LeaveLayer(it); | 905 occlusion_tracker.LeaveLayer(it); |
906 } | 906 } |
907 | 907 |
908 unoccluded_screen_space_region_ = | 908 unoccluded_screen_space_region_ = |
909 occlusion_tracker.ComputeVisibleRegionInScreen(); | 909 occlusion_tracker.ComputeVisibleRegionInScreen(this); |
910 } | 910 } |
911 | 911 |
912 // It'd be ideal if this could be done earlier, but when the raster source | 912 // It'd be ideal if this could be done earlier, but when the raster source |
913 // is updated from the main thread during push properties, update draw | 913 // is updated from the main thread during push properties, update draw |
914 // properties has not occurred yet and so it's not clear whether or not the | 914 // properties has not occurred yet and so it's not clear whether or not the |
915 // layer can or cannot use lcd text. So, this is the cleanup pass to | 915 // layer can or cannot use lcd text. So, this is the cleanup pass to |
916 // determine if the raster source needs to be replaced with a non-lcd | 916 // determine if the raster source needs to be replaced with a non-lcd |
917 // raster source due to draw properties. | 917 // raster source due to draw properties. |
918 if (update_lcd_text) { | 918 if (update_lcd_text) { |
919 // TODO(enne): Make LTHI::sync_tree return this value. | 919 // TODO(enne): Make LTHI::sync_tree return this value. |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2093 } | 2093 } |
2094 | 2094 |
2095 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { | 2095 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { |
2096 layers_that_should_push_properties_.clear(); | 2096 layers_that_should_push_properties_.clear(); |
2097 for (auto* layer : *this) | 2097 for (auto* layer : *this) |
2098 layer->ResetChangeTracking(); | 2098 layer->ResetChangeTracking(); |
2099 property_trees_.ResetAllChangeTracking(flag); | 2099 property_trees_.ResetAllChangeTracking(flag); |
2100 } | 2100 } |
2101 | 2101 |
2102 } // namespace cc | 2102 } // namespace cc |
OLD | NEW |