Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: cc/surfaces/display_scheduler.cc

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Rebasing + dusting off... Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/quads/surface_draw_quad.cc ('k') | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/quads/surface_draw_quad.cc ('k') | cc/surfaces/display_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698