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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
742 active_tree_->background_color(), | 742 active_tree_->background_color(), |
743 occlusion_tracker); | 743 occlusion_tracker); |
744 } | 744 } |
745 | 745 |
746 if (draw_frame) | 746 if (draw_frame) |
747 occlusion_tracker.overdraw_metrics()->RecordMetrics(this); | 747 occlusion_tracker.overdraw_metrics()->RecordMetrics(this); |
748 else | 748 else |
749 DCHECK(!have_copy_request); | 749 DCHECK(!have_copy_request); |
750 | 750 |
751 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); | 751 RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); |
752 if (!output_surface_->ForcedDrawToSoftwareDevice()) | 752 if (!output_surface_->ForcedDrawToSoftwareDevice()) |
danakj
2013/06/20 18:00:33
Should this go away (in another CL)?
boliu
2013/06/20 21:01:43
I think so after the WillDraw change that skips dr
| |
753 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); | 753 renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); |
754 if (renderer_) { | 754 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), |
boliu
2013/06/20 17:13:53
I'm not sure why this was added. Renderer was alwa
| |
755 RemoveRenderPasses(CullRenderPassesWithCachedTextures(renderer_.get()), | 755 frame); |
756 frame); | |
757 } | |
758 | 756 |
759 // If we're making a frame to draw, it better have at least one render pass. | 757 // If we're making a frame to draw, it better have at least one render pass. |
760 DCHECK(!frame->render_passes.empty()); | 758 DCHECK(!frame->render_passes.empty()); |
761 return draw_frame; | 759 return draw_frame; |
762 } | 760 } |
763 | 761 |
764 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { | 762 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { |
765 if (input_handler_client_) | 763 if (input_handler_client_) |
766 input_handler_client_->MainThreadHasStoppedFlinging(); | 764 input_handler_client_->MainThreadHasStoppedFlinging(); |
767 } | 765 } |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1211 } | 1209 } |
1212 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); | 1210 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); |
1213 } | 1211 } |
1214 | 1212 |
1215 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1213 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
1216 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1214 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
1217 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); | 1215 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); |
1218 | 1216 |
1219 // Once all layers have been drawn, pending texture uploads should no | 1217 // Once all layers have been drawn, pending texture uploads should no |
1220 // longer block future uploads. | 1218 // longer block future uploads. |
1221 if (resource_provider_) | 1219 resource_provider_->MarkPendingUploadsAsNonBlocking(); |
1222 resource_provider_->MarkPendingUploadsAsNonBlocking(); | |
1223 } | 1220 } |
1224 | 1221 |
1225 void LayerTreeHostImpl::FinishAllRendering() { | 1222 void LayerTreeHostImpl::FinishAllRendering() { |
1226 if (renderer_) | 1223 if (renderer_) |
1227 renderer_->Finish(); | 1224 renderer_->Finish(); |
1228 } | 1225 } |
1229 | 1226 |
1230 bool LayerTreeHostImpl::IsContextLost() { | 1227 bool LayerTreeHostImpl::IsContextLost() { |
1231 DCHECK(proxy_->IsImplThread()); | 1228 DCHECK(proxy_->IsImplThread()); |
1232 return renderer_ && renderer_->IsContextLost(); | 1229 return renderer_ && renderer_->IsContextLost(); |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2363 } | 2360 } |
2364 | 2361 |
2365 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { | 2362 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { |
2366 if (debug_state_.continuous_painting != debug_state.continuous_painting) | 2363 if (debug_state_.continuous_painting != debug_state.continuous_painting) |
2367 paint_time_counter_->ClearHistory(); | 2364 paint_time_counter_->ClearHistory(); |
2368 | 2365 |
2369 debug_state_ = debug_state; | 2366 debug_state_ = debug_state; |
2370 } | 2367 } |
2371 | 2368 |
2372 } // namespace cc | 2369 } // namespace cc |
OLD | NEW |