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

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: Created 5 years 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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