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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 LayerTreeImpl* sync_tree = layer_tree_host_impl_->CommitToActiveTree() | 829 LayerTreeImpl* sync_tree = layer_tree_host_impl_->CommitToActiveTree() |
830 ? layer_tree_host_impl_->active_tree() | 830 ? layer_tree_host_impl_->active_tree() |
831 : layer_tree_host_impl_->pending_tree(); | 831 : layer_tree_host_impl_->pending_tree(); |
832 // If this is not the sync tree, then it is not safe to update lcd text | 832 // If this is not the sync tree, then it is not safe to update lcd text |
833 // as it causes invalidations and the tiles may be in use. | 833 // as it causes invalidations and the tiles may be in use. |
834 DCHECK_EQ(this, sync_tree); | 834 DCHECK_EQ(this, sync_tree); |
835 for (const auto& layer : picture_layers_) | 835 for (const auto& layer : picture_layers_) |
836 layer->UpdateCanUseLCDTextAfterCommit(); | 836 layer->UpdateCanUseLCDTextAfterCommit(); |
837 } | 837 } |
838 | 838 |
839 { | 839 // Resourceless draw do not need tiles and should not affect existing tile |
| 840 // priorities. |
| 841 if (layer_tree_host_impl_->GetDrawMode() != DRAW_MODE_RESOURCELESS_SOFTWARE) { |
840 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 842 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
841 "IsActive", IsActiveTree(), "SourceFrameNumber", | 843 "IsActive", IsActiveTree(), "SourceFrameNumber", |
842 source_frame_number_); | 844 source_frame_number_); |
843 const bool resourceless_software_draw = | |
844 (layer_tree_host_impl_->GetDrawMode() == | |
845 DRAW_MODE_RESOURCELESS_SOFTWARE); | |
846 size_t layers_updated_count = 0; | 845 size_t layers_updated_count = 0; |
847 bool tile_priorities_updated = false; | 846 bool tile_priorities_updated = false; |
848 for (PictureLayerImpl* layer : picture_layers_) { | 847 for (PictureLayerImpl* layer : picture_layers_) { |
849 if (!layer->IsDrawnRenderSurfaceLayerListMember()) | 848 if (!layer->IsDrawnRenderSurfaceLayerListMember()) |
850 continue; | 849 continue; |
851 ++layers_updated_count; | 850 ++layers_updated_count; |
852 tile_priorities_updated |= layer->UpdateTiles(resourceless_software_draw); | 851 tile_priorities_updated |= layer->UpdateTiles(); |
853 } | 852 } |
854 | 853 |
855 if (tile_priorities_updated) | 854 if (tile_priorities_updated) |
856 DidModifyTilePriorities(); | 855 DidModifyTilePriorities(); |
857 | 856 |
858 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 857 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
859 "layers_updated_count", layers_updated_count); | 858 "layers_updated_count", layers_updated_count); |
860 } | 859 } |
861 | 860 |
862 DCHECK(!needs_update_draw_properties_) << | 861 DCHECK(!needs_update_draw_properties_) << |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 const gfx::BoxF& box, | 2074 const gfx::BoxF& box, |
2076 gfx::BoxF* bounds) const { | 2075 gfx::BoxF* bounds) const { |
2077 *bounds = gfx::BoxF(); | 2076 *bounds = gfx::BoxF(); |
2078 return layer_tree_host_impl_->animation_host() | 2077 return layer_tree_host_impl_->animation_host() |
2079 ? layer_tree_host_impl_->animation_host() | 2078 ? layer_tree_host_impl_->animation_host() |
2080 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 2079 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
2081 : true; | 2080 : true; |
2082 } | 2081 } |
2083 | 2082 |
2084 } // namespace cc | 2083 } // namespace cc |
OLD | NEW |