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/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 TRACE_EVENT0("cc", "DisplayScheduler::SetNewRootSurface"); | 75 TRACE_EVENT0("cc", "DisplayScheduler::SetNewRootSurface"); |
76 root_surface_id_ = root_surface_id; | 76 root_surface_id_ = root_surface_id; |
77 SurfaceDamaged(root_surface_id); | 77 SurfaceDamaged(root_surface_id); |
78 } | 78 } |
79 | 79 |
80 // Indicates that there was damage to one of the surfaces. | 80 // Indicates that there was damage to one of the surfaces. |
81 // Has some logic to wait for multiple active surfaces before | 81 // Has some logic to wait for multiple active surfaces before |
82 // triggering the deadline. | 82 // triggering the deadline. |
83 void DisplayScheduler::SurfaceDamaged(SurfaceId surface_id) { | 83 void DisplayScheduler::SurfaceDamaged(SurfaceId surface_id) { |
84 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamaged", "surface_id", | 84 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamaged", "surface_id", |
85 surface_id.id); | 85 surface_id.GetUnsafeValue()); |
86 | 86 |
87 needs_draw_ = true; | 87 needs_draw_ = true; |
88 | 88 |
89 if (surface_id == root_surface_id_) { | 89 if (surface_id == root_surface_id_) { |
90 root_surface_damaged_ = true; | 90 root_surface_damaged_ = true; |
91 expecting_root_surface_damage_because_of_resize_ = false; | 91 expecting_root_surface_damage_because_of_resize_ = false; |
92 } else { | 92 } else { |
93 child_surface_ids_damaged_.insert(surface_id); | 93 child_surface_ids_damaged_.insert(surface_id); |
94 | 94 |
95 // TODO(mithro): Use hints from SetNeedsBeginFrames and SwapAborts. | 95 // TODO(mithro): Use hints from SetNeedsBeginFrames and SwapAborts. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 } | 303 } |
304 | 304 |
305 void DisplayScheduler::DidSwapBuffersComplete() { | 305 void DisplayScheduler::DidSwapBuffersComplete() { |
306 pending_swaps_--; | 306 pending_swaps_--; |
307 TRACE_EVENT_ASYNC_END1("cc", "DisplayScheduler:pending_swaps", this, | 307 TRACE_EVENT_ASYNC_END1("cc", "DisplayScheduler:pending_swaps", this, |
308 "pending_frames", pending_swaps_); | 308 "pending_frames", pending_swaps_); |
309 ScheduleBeginFrameDeadline(); | 309 ScheduleBeginFrameDeadline(); |
310 } | 310 } |
311 | 311 |
312 } // namespace cc | 312 } // namespace cc |
OLD | NEW |