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