Chromium Code Reviews| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 bool pending_surfaces_changed = false; | 130 bool pending_surfaces_changed = false; |
| 131 if (display_damaged || valid_ack) | 131 if (display_damaged || valid_ack) |
| 132 pending_surfaces_changed = UpdateHasPendingSurfaces(); | 132 pending_surfaces_changed = UpdateHasPendingSurfaces(); |
| 133 | 133 |
| 134 if (display_damaged || pending_surfaces_changed) | 134 if (display_damaged || pending_surfaces_changed) |
| 135 ScheduleBeginFrameDeadline(); | 135 ScheduleBeginFrameDeadline(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void DisplayScheduler::SurfaceCreated(const SurfaceInfo& surface_info) { | 138 void DisplayScheduler::SurfaceCreated(const SurfaceInfo& surface_info) { |
| 139 SurfaceId surface_id = surface_info.id(); | 139 SurfaceId surface_id = surface_info.id(); |
| 140 DCHECK(!base::ContainsKey(surface_states_, surface_id)); | 140 DCHECK(!base::ContainsKey(surface_states_, surface_id)); |
|
Eric Seckler
2017/06/02 12:01:16
Hm, and it looks like this is no longer necessaril
| |
| 141 surface_states_[surface_id] = SurfaceBeginFrameState(); | 141 surface_states_[surface_id] = SurfaceBeginFrameState(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void DisplayScheduler::SurfaceDestroyed(const SurfaceId& surface_id) { | 144 void DisplayScheduler::SurfaceDiscarded(const SurfaceId& surface_id) { |
| 145 auto it = surface_states_.find(surface_id); | 145 auto it = surface_states_.find(surface_id); |
| 146 if (it == surface_states_.end()) | 146 if (it == surface_states_.end()) |
| 147 return; | 147 return; |
| 148 surface_states_.erase(it); | 148 surface_states_.erase(it); |
| 149 if (UpdateHasPendingSurfaces()) | 149 if (UpdateHasPendingSurfaces()) |
| 150 ScheduleBeginFrameDeadline(); | 150 ScheduleBeginFrameDeadline(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void DisplayScheduler::SurfaceDamageExpected(const SurfaceId& surface_id, | 153 void DisplayScheduler::SurfaceDamageExpected(const SurfaceId& surface_id, |
| 154 const BeginFrameArgs& args) { | 154 const BeginFrameArgs& args) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 } | 427 } |
| 428 | 428 |
| 429 void DisplayScheduler::DidReceiveSwapBuffersAck() { | 429 void DisplayScheduler::DidReceiveSwapBuffersAck() { |
| 430 uint32_t swap_id = next_swap_id_ - pending_swaps_; | 430 uint32_t swap_id = next_swap_id_ - pending_swaps_; |
| 431 pending_swaps_--; | 431 pending_swaps_--; |
| 432 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id); | 432 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id); |
| 433 ScheduleBeginFrameDeadline(); | 433 ScheduleBeginFrameDeadline(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace cc | 436 } // namespace cc |
| OLD | NEW |