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

Unified Diff: cc/scheduler/scheduler.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 4c2316fc048ac5d8bee6004f850621d398b7eed3..701a4bfe2f1d58114440eb0c440ad061fba591de 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -5,6 +5,7 @@
#include "cc/scheduler/scheduler.h"
#include <algorithm>
+
#include "base/auto_reset.h"
#include "base/debug/trace_event.h"
#include "base/debug/trace_event_argument.h"
@@ -32,8 +33,10 @@ BeginFrameSource* SchedulerFrameSourcesConstructor::ConstructPrimaryFrameSource(
TRACE_EVENT1("cc",
"Scheduler::Scheduler()",
"PrimaryFrameSource",
- "SchedulerClient");
- return scheduler->client_->ExternalBeginFrameSource();
+ "ExternalBeginFrameSource");
+ DCHECK(scheduler->primary_frame_source_internal_)
+ << "Need external BeginFrameSource";
+ return scheduler->primary_frame_source_internal_.get();
} else {
TRACE_EVENT1("cc",
"Scheduler::Scheduler()",
@@ -74,11 +77,12 @@ Scheduler::Scheduler(
int layer_tree_host_id,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
base::PowerMonitor* power_monitor,
+ scoped_ptr<BeginFrameSource> external_begin_frame_source,
SchedulerFrameSourcesConstructor* frame_sources_constructor)
: frame_source_(),
primary_frame_source_(NULL),
background_frame_source_(NULL),
- primary_frame_source_internal_(),
+ primary_frame_source_internal_(external_begin_frame_source.Pass()),
background_frame_source_internal_(),
vsync_observer_(NULL),
settings_(scheduler_settings),
@@ -114,6 +118,7 @@ Scheduler::Scheduler(
primary_frame_source_ =
frame_sources_constructor->ConstructPrimaryFrameSource(this);
frame_source_->AddSource(primary_frame_source_);
+ primary_frame_source_->SetClientReady();
// Background ticking frame source
background_frame_source_ =
@@ -125,6 +130,8 @@ Scheduler::Scheduler(
Scheduler::~Scheduler() {
TeardownPowerMonitoring();
+ if (frame_source_->NeedsBeginFrames())
+ frame_source_->SetNeedsBeginFrames(false);
}
base::TimeTicks Scheduler::Now() const {
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698