Commit 96b5967f authored by simonhong's avatar simonhong Committed by Commit bot

cc: Use Scheduler::BeginFrame() in SingleThreadProxy

Proxy should use BeginFrame() to request new BeginFrame instead of BeginImplFrame().
The scheduler turns BeginFrames into BeginImplFrames or BeginRetroFrames
as necessary to make sure we don't start a new BeginImplFrame
before the previous deadline.

Some of public methods that are only used by itself moved into the private.

R=brianderson@chromium.org
BUG=NONE
TEST=cc_unittests

Review URL: https://codereview.chromium.org/536123002

Cr-Commit-Position: refs/heads/master@{#293259}
parent 22c9c3bd
...@@ -607,11 +607,6 @@ void Scheduler::PollToAdvanceCommitState() { ...@@ -607,11 +607,6 @@ void Scheduler::PollToAdvanceCommitState() {
ProcessScheduledActions(); ProcessScheduledActions();
} }
bool Scheduler::IsBeginMainFrameSent() const {
return state_machine_.commit_state() ==
SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT;
}
void Scheduler::DrawAndSwapIfPossible() { void Scheduler::DrawAndSwapIfPossible() {
DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible();
state_machine_.DidDrawIfPossibleCompleted(result); state_machine_.DidDrawIfPossibleCompleted(result);
......
...@@ -124,28 +124,11 @@ class CC_EXPORT Scheduler { ...@@ -124,28 +124,11 @@ class CC_EXPORT Scheduler {
void NotifyBeginMainFrameStarted(); void NotifyBeginMainFrameStarted();
base::TimeTicks LastBeginImplFrameTime(); base::TimeTicks LastBeginImplFrameTime();
base::TimeDelta VSyncInterval() { return vsync_interval_; }
base::TimeDelta EstimatedParentDrawTime() {
return estimated_parent_draw_time_;
}
void BeginFrame(const BeginFrameArgs& args); void BeginFrame(const BeginFrameArgs& args);
void PostBeginRetroFrame();
void BeginRetroFrame();
void BeginUnthrottledFrame();
void BeginImplFrame(const BeginFrameArgs& args);
void OnBeginImplFrameDeadline();
void PollForAnticipatedDrawTriggers();
void PollToAdvanceCommitState();
scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
bool IsInsideAction(SchedulerStateMachine::Action action) {
return inside_action_ == action;
}
bool IsBeginMainFrameSent() const;
void SetContinuousPainting(bool continuous_painting) { void SetContinuousPainting(bool continuous_painting) {
state_machine_.SetContinuousPainting(continuous_painting); state_machine_.SetContinuousPainting(continuous_painting);
} }
...@@ -231,6 +214,22 @@ class CC_EXPORT Scheduler { ...@@ -231,6 +214,22 @@ class CC_EXPORT Scheduler {
void AdvanceCommitStateIfPossible(); void AdvanceCommitStateIfPossible();
bool IsBeginMainFrameSentOrStarted() const; bool IsBeginMainFrameSentOrStarted() const;
void SetupSyntheticBeginFrames(); void SetupSyntheticBeginFrames();
void BeginRetroFrame();
void BeginUnthrottledFrame();
void BeginImplFrame(const BeginFrameArgs& args);
void OnBeginImplFrameDeadline();
void PollForAnticipatedDrawTriggers();
void PollToAdvanceCommitState();
base::TimeDelta VSyncInterval() { return vsync_interval_; }
base::TimeDelta EstimatedParentDrawTime() {
return estimated_parent_draw_time_;
}
bool IsInsideAction(SchedulerStateMachine::Action action) {
return inside_action_ == action;
}
base::WeakPtrFactory<Scheduler> weak_factory_; base::WeakPtrFactory<Scheduler> weak_factory_;
......
...@@ -432,7 +432,7 @@ void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() { ...@@ -432,7 +432,7 @@ void SingleThreadProxy::DidSwapBuffersCompleteOnImplThread() {
void SingleThreadProxy::BeginFrame(const BeginFrameArgs& args) { void SingleThreadProxy::BeginFrame(const BeginFrameArgs& args) {
TRACE_EVENT0("cc", "SingleThreadProxy::BeginFrame"); TRACE_EVENT0("cc", "SingleThreadProxy::BeginFrame");
if (scheduler_on_impl_thread_) if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->BeginImplFrame(args); scheduler_on_impl_thread_->BeginFrame(args);
} }
void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) { void SingleThreadProxy::CompositeImmediately(base::TimeTicks frame_begin_time) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment