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

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

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; refactor mus output surface Created 4 years, 8 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
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 16 matching lines...) Expand all
27 all_active_child_surfaces_ready_to_draw_(false), 27 all_active_child_surfaces_ready_to_draw_(false),
28 pending_swaps_(0), 28 pending_swaps_(0),
29 max_pending_swaps_(max_pending_swaps), 29 max_pending_swaps_(max_pending_swaps),
30 observing_begin_frame_source_(false), 30 observing_begin_frame_source_(false),
31 root_surface_damaged_(false), 31 root_surface_damaged_(false),
32 expect_damage_from_root_surface_(false), 32 expect_damage_from_root_surface_(false),
33 weak_ptr_factory_(this) { 33 weak_ptr_factory_(this) {
34 begin_frame_deadline_closure_ = base::Bind( 34 begin_frame_deadline_closure_ = base::Bind(
35 &DisplayScheduler::OnBeginFrameDeadline, weak_ptr_factory_.GetWeakPtr()); 35 &DisplayScheduler::OnBeginFrameDeadline, weak_ptr_factory_.GetWeakPtr());
36 36
37 // TODO(tansell): Set this to something useful. 37 // TODO(enne): For now, this is always the same, so just set initially.
38 begin_frame_source_for_children_.reset(new SyntheticBeginFrameSource( 38 client_->UpdateSchedulerBeginFrameSource(begin_frame_source_);
39 task_runner, BeginFrameArgs::DefaultInterval()));
40 } 39 }
41 40
42 DisplayScheduler::~DisplayScheduler() { 41 DisplayScheduler::~DisplayScheduler() {
43 if (observing_begin_frame_source_) 42 if (observing_begin_frame_source_)
44 begin_frame_source_->RemoveObserver(this); 43 begin_frame_source_->RemoveObserver(this);
45 } 44 }
46 45
47 // If we try to draw when the root surface resources are locked, the 46 // If we try to draw when the root surface resources are locked, the
48 // draw will fail. 47 // draw will fail.
49 void DisplayScheduler::SetRootSurfaceResourcesLocked(bool locked) { 48 void DisplayScheduler::SetRootSurfaceResourcesLocked(bool locked) {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 302 }
304 303
305 void DisplayScheduler::DidSwapBuffersComplete() { 304 void DisplayScheduler::DidSwapBuffersComplete() {
306 pending_swaps_--; 305 pending_swaps_--;
307 TRACE_EVENT_ASYNC_END1("cc", "DisplayScheduler:pending_swaps", this, 306 TRACE_EVENT_ASYNC_END1("cc", "DisplayScheduler:pending_swaps", this,
308 "pending_frames", pending_swaps_); 307 "pending_frames", pending_swaps_);
309 ScheduleBeginFrameDeadline(); 308 ScheduleBeginFrameDeadline();
310 } 309 }
311 310
312 } // namespace cc 311 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698