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