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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
855 active_tree_->background_color(), | 855 active_tree_->background_color(), |
856 occlusion_tracker); | 856 occlusion_tracker); |
857 } | 857 } |
858 | 858 |
859 if (draw_frame) | 859 if (draw_frame) |
860 occlusion_tracker.overdraw_metrics()->RecordMetrics(this); | 860 occlusion_tracker.overdraw_metrics()->RecordMetrics(this); |
861 else | 861 else |
862 DCHECK(!have_copy_request); | 862 DCHECK(!have_copy_request); |
863 | 863 |
864 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); | 864 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); |
865 if (!output_surface_->ForcedDrawToSoftwareDevice()) | 865 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); |
866 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); | |
867 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), | 866 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), |
868 frame); | 867 frame); |
869 | 868 |
870 // Any copy requests left in the tree are not going to get serviced, and | 869 // Any copy requests left in the tree are not going to get serviced, and |
871 // should be aborted. | 870 // should be aborted. |
872 ScopedPtrVector<CopyOutputRequest> requests_to_abort; | 871 ScopedPtrVector<CopyOutputRequest> requests_to_abort; |
873 while (!active_tree_->LayersWithCopyOutputRequest().empty()) { | 872 while (!active_tree_->LayersWithCopyOutputRequest().empty()) { |
874 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); | 873 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); |
875 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); | 874 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); |
876 } | 875 } |
877 for (size_t i = 0; i < requests_to_abort.size(); ++i) | 876 for (size_t i = 0; i < requests_to_abort.size(); ++i) |
878 requests_to_abort[i]->SendEmptyResult(); | 877 requests_to_abort[i]->SendEmptyResult(); |
879 | 878 |
880 // If we're making a frame to draw, it better have at least one render pass. | 879 // If we're making a frame to draw, it better have at least one render pass. |
881 DCHECK(!frame->render_passes.empty()); | 880 DCHECK(!frame->render_passes.empty()); |
881 | |
882 // Should only have one render pass in forced-draw mode. | |
danakj
2013/09/24 14:47:04
in resourceless software mode.
| |
883 if (output_surface_->ForcedDrawToSoftwareDevice()) | |
884 DCHECK_EQ(1u, frame->render_passes.size()); | |
885 | |
882 return draw_frame; | 886 return draw_frame; |
883 } | 887 } |
884 | 888 |
885 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { | 889 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { |
886 if (input_handler_client_) | 890 if (input_handler_client_) |
887 input_handler_client_->MainThreadHasStoppedFlinging(); | 891 input_handler_client_->MainThreadHasStoppedFlinging(); |
888 } | 892 } |
889 | 893 |
890 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( | 894 void LayerTreeHostImpl::UpdateBackgroundAnimateTicking( |
891 bool should_background_tick) { | 895 bool should_background_tick) { |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2704 std::set<UIResourceId>::iterator found_in_evicted = | 2708 std::set<UIResourceId>::iterator found_in_evicted = |
2705 evicted_ui_resources_.find(uid); | 2709 evicted_ui_resources_.find(uid); |
2706 if (found_in_evicted == evicted_ui_resources_.end()) | 2710 if (found_in_evicted == evicted_ui_resources_.end()) |
2707 return; | 2711 return; |
2708 evicted_ui_resources_.erase(found_in_evicted); | 2712 evicted_ui_resources_.erase(found_in_evicted); |
2709 if (evicted_ui_resources_.empty()) | 2713 if (evicted_ui_resources_.empty()) |
2710 client_->OnCanDrawStateChanged(CanDraw()); | 2714 client_->OnCanDrawStateChanged(CanDraw()); |
2711 } | 2715 } |
2712 | 2716 |
2713 } // namespace cc | 2717 } // namespace cc |
OLD | NEW |