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

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

Issue 2938833002: Add SurfaceWillDraw notification (Closed)
Patch Set: add unit test to verify that OnSurfaceWillDraw is called only for surfaces added to the CompositorF… Created 3 years, 6 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/surfaces/display_scheduler.h ('k') | cc/surfaces/surface_aggregator.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/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamageExpected", "surface_id", 307 TRACE_EVENT1("cc", "DisplayScheduler::SurfaceDamageExpected", "surface_id",
308 surface_id.ToString()); 308 surface_id.ToString());
309 auto it = surface_states_.find(surface_id); 309 auto it = surface_states_.find(surface_id);
310 if (it == surface_states_.end()) 310 if (it == surface_states_.end())
311 return; 311 return;
312 it->second.last_args = args; 312 it->second.last_args = args;
313 if (UpdateHasPendingSurfaces()) 313 if (UpdateHasPendingSurfaces())
314 ScheduleBeginFrameDeadline(); 314 ScheduleBeginFrameDeadline();
315 } 315 }
316 316
317 void DisplayScheduler::OnSurfaceWillDraw(const SurfaceId& surface_id) {}
318
317 base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() { 319 base::TimeTicks DisplayScheduler::DesiredBeginFrameDeadlineTime() {
318 if (output_surface_lost_) { 320 if (output_surface_lost_) {
319 TRACE_EVENT_INSTANT0("cc", "Lost output surface", TRACE_EVENT_SCOPE_THREAD); 321 TRACE_EVENT_INSTANT0("cc", "Lost output surface", TRACE_EVENT_SCOPE_THREAD);
320 return base::TimeTicks(); 322 return base::TimeTicks();
321 } 323 }
322 324
323 if (pending_swaps_ >= max_pending_swaps_) { 325 if (pending_swaps_ >= max_pending_swaps_) {
324 TRACE_EVENT_INSTANT0("cc", "Swap throttled", TRACE_EVENT_SCOPE_THREAD); 326 TRACE_EVENT_INSTANT0("cc", "Swap throttled", TRACE_EVENT_SCOPE_THREAD);
325 return current_begin_frame_args_.frame_time + 327 return current_begin_frame_args_.frame_time +
326 current_begin_frame_args_.interval; 328 current_begin_frame_args_.interval;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 437 }
436 438
437 void DisplayScheduler::DidReceiveSwapBuffersAck() { 439 void DisplayScheduler::DidReceiveSwapBuffersAck() {
438 uint32_t swap_id = next_swap_id_ - pending_swaps_; 440 uint32_t swap_id = next_swap_id_ - pending_swaps_;
439 pending_swaps_--; 441 pending_swaps_--;
440 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id); 442 TRACE_EVENT_ASYNC_END0("cc", "DisplayScheduler:pending_swaps", swap_id);
441 ScheduleBeginFrameDeadline(); 443 ScheduleBeginFrameDeadline();
442 } 444 }
443 445
444 } // namespace cc 446 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_scheduler.h ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698