| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 TRACE_EVENT0("cc", "DisplayScheduler::SetNewRootSurface"); | 74 TRACE_EVENT0("cc", "DisplayScheduler::SetNewRootSurface"); |
| 75 root_surface_id_ = root_surface_id; | 75 root_surface_id_ = root_surface_id; |
| 76 SurfaceDamaged(root_surface_id); | 76 SurfaceDamaged(root_surface_id); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Indicates that there was damage to one of the surfaces. | 79 // Indicates that there was damage to one of the surfaces. |
| 80 // Has some logic to wait for multiple active surfaces before | 80 // Has some logic to wait for multiple active surfaces before |
| 81 // triggering the deadline. | 81 // triggering the deadline. |
| 82 void DisplayScheduler::SurfaceDamaged(SurfaceId surface_id) { | 82 void DisplayScheduler::SurfaceDamaged(SurfaceId surface_id) { |
| 83 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamaged", "surface_id", | 83 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamaged", "surface_id", |
| 84 surface_id.id); | 84 surface_id.GetUnsafeValue()); |
| 85 | 85 |
| 86 needs_draw_ = true; | 86 needs_draw_ = true; |
| 87 | 87 |
| 88 if (surface_id == root_surface_id_) { | 88 if (surface_id == root_surface_id_) { |
| 89 root_surface_damaged_ = true; | 89 root_surface_damaged_ = true; |
| 90 expecting_root_surface_damage_because_of_resize_ = false; | 90 expecting_root_surface_damage_because_of_resize_ = false; |
| 91 } else { | 91 } else { |
| 92 child_surface_ids_damaged_.insert(surface_id); | 92 child_surface_ids_damaged_.insert(surface_id); |
| 93 | 93 |
| 94 // TODO(mithro): Use hints from SetNeedsBeginFrames and SwapAborts. | 94 // TODO(mithro): Use hints from SetNeedsBeginFrames and SwapAborts. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 void DisplayScheduler::DidSwapBuffersComplete() { | 291 void DisplayScheduler::DidSwapBuffersComplete() { |
| 292 pending_swaps_--; | 292 pending_swaps_--; |
| 293 TRACE_EVENT1("cc", "DisplayScheduler::DidSwapBuffersComplete", | 293 TRACE_EVENT1("cc", "DisplayScheduler::DidSwapBuffersComplete", |
| 294 "pending_frames", pending_swaps_); | 294 "pending_frames", pending_swaps_); |
| 295 ScheduleBeginFrameDeadline(); | 295 ScheduleBeginFrameDeadline(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace cc | 298 } // namespace cc |
| OLD | NEW |