| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surfaces/display_scheduler.h" | 5 #include "cc/surfaces/display_scheduler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamageExpected", "surface_id", | 307 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamageExpected", "surface_id", |
| 308 surface_id.ToString()); | 308 surface_id.ToString()); |
| 309 auto it = surface_states_.find(surface_id); | 309 auto it = surface_states_.find(surface_id); |
| 310 if (it == surface_states_.end()) | 310 if (it == surface_states_.end()) |
| 311 return; | 311 return; |
| 312 it->second.last_args = args; | 312 it->second.last_args = args; |
| 313 if (UpdateHasPendingSurfaces()) | 313 if (UpdateHasPendingSurfaces()) |
| 314 ScheduleBeginFrameDeadline(); | 314 ScheduleBeginFrameDeadline(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 void DisplayScheduler::OnSurfaceWillDraw(const SurfaceId& surface_id) {} |
| 318 |
| 317 base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() { | 319 base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() { |
| 318 if (output_surface_lost_) { | 320 if (output_surface_lost_) { |
| 319 TRACE_EVENT_INSTANT0("cc", "Lost output surface", TRACE_EVENT_SCOPE_THREAD); | 321 TRACE_EVENT_INSTANT0("cc", "Lost output surface", TRACE_EVENT_SCOPE_THREAD); |
| 320 return base::TimeTicks(); | 322 return base::TimeTicks(); |
| 321 } | 323 } |
| 322 | 324 |
| 323 if (pending_swaps_ >= max_pending_swaps_) { | 325 if (pending_swaps_ >= max_pending_swaps_) { |
| 324 TRACE_EVENT_INSTANT0("cc", "Swap throttled", TRACE_EVENT_SCOPE_THREAD); | 326 TRACE_EVENT_INSTANT0("cc", "Swap throttled", TRACE_EVENT_SCOPE_THREAD); |
| 325 return current_begin_frame_args_.frame_time + | 327 return current_begin_frame_args_.frame_time + |
| 326 current_begin_frame_args_.interval; | 328 current_begin_frame_args_.interval; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 437 } |
| 436 | 438 |
| 437 void DisplayScheduler::DidReceiveSwapBuffersAck() { | 439 void DisplayScheduler::DidReceiveSwapBuffersAck() { |
| 438 uint32_t swap_id = next_swap_id_ - pending_swaps_; | 440 uint32_t swap_id = next_swap_id_ - pending_swaps_; |
| 439 pending_swaps_--; | 441 pending_swaps_--; |
| 440 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id); | 442 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id); |
| 441 ScheduleBeginFrameDeadline(); | 443 ScheduleBeginFrameDeadline(); |
| 442 } | 444 } |
| 443 | 445 |
| 444 } // namespace cc | 446 } // namespace cc |
| OLD | NEW |