| 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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 TRACE_EVENT0("cc", "EarlyOut_NoDamage"); | 1338 TRACE_EVENT0("cc", "EarlyOut_NoDamage"); |
| 1339 DCHECK(!output_surface_->capabilities() | 1339 DCHECK(!output_surface_->capabilities() |
| 1340 .draw_and_swap_full_viewport_every_frame); | 1340 .draw_and_swap_full_viewport_every_frame); |
| 1341 return; | 1341 return; |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 DCHECK(!frame->render_passes.empty()); | 1344 DCHECK(!frame->render_passes.empty()); |
| 1345 | 1345 |
| 1346 fps_counter_->SaveTimeStamp(frame_begin_time, | 1346 fps_counter_->SaveTimeStamp(frame_begin_time, |
| 1347 !output_surface_->context_provider()); | 1347 !output_surface_->context_provider()); |
| 1348 | |
| 1349 bool on_main_thread = false; | 1348 bool on_main_thread = false; |
| 1350 rendering_stats_instrumentation_->IncrementFrameCount( | 1349 rendering_stats_instrumentation_->IncrementFrameCount( |
| 1351 1, on_main_thread); | 1350 1, on_main_thread); |
| 1352 | 1351 |
| 1353 if (tile_manager_) { | 1352 if (tile_manager_) { |
| 1354 memory_history_->SaveEntry( | 1353 memory_history_->SaveEntry( |
| 1355 tile_manager_->memory_stats_from_last_assign()); | 1354 tile_manager_->memory_stats_from_last_assign()); |
| 1356 } | 1355 } |
| 1357 | 1356 |
| 1358 if (debug_state_.ShowHudRects()) { | 1357 if (debug_state_.ShowHudRects()) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 // The next frame should start by assuming nothing has changed, and changes | 1431 // The next frame should start by assuming nothing has changed, and changes |
| 1433 // are noted as they occur. | 1432 // are noted as they occur. |
| 1434 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1433 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
| 1435 // damage forward to the next frame. | 1434 // damage forward to the next frame. |
| 1436 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1435 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
| 1437 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> | 1436 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> |
| 1438 DidDrawDamagedArea(); | 1437 DidDrawDamagedArea(); |
| 1439 } | 1438 } |
| 1440 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); | 1439 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); |
| 1441 | 1440 |
| 1441 devtools_instrumentation::didDrawFrame(id_); |
| 1442 BenchmarkInstrumentation::IssueImplThreadRenderingStatsEvent( | 1442 BenchmarkInstrumentation::IssueImplThreadRenderingStatsEvent( |
| 1443 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1443 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
| 1444 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1444 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1447 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
| 1448 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1448 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
| 1449 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); | 1449 frame.will_draw_layers[i]->DidDraw(resource_provider_.get()); |
| 1450 | 1450 |
| 1451 // Once all layers have been drawn, pending texture uploads should no | 1451 // Once all layers have been drawn, pending texture uploads should no |
| (...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 swap_promise_monitor_.erase(monitor); | 2989 swap_promise_monitor_.erase(monitor); |
| 2990 } | 2990 } |
| 2991 | 2991 |
| 2992 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 2992 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 2993 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 2993 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 2994 for (; it != swap_promise_monitor_.end(); it++) | 2994 for (; it != swap_promise_monitor_.end(); it++) |
| 2995 (*it)->OnSetNeedsRedrawOnImpl(); | 2995 (*it)->OnSetNeedsRedrawOnImpl(); |
| 2996 } | 2996 } |
| 2997 | 2997 |
| 2998 } // namespace cc | 2998 } // namespace cc |
| OLD | NEW |