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

Unified Diff: cc/scheduler/scheduler.h

Issue 221833009: cc: Move scheduling logic out of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@swapAck2Sched11
Patch Set: rebase; fix tests Created 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/scheduler.h
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
index d4e3e6510e53bae5991388c1ed9c4654f3c49489..2387a38664ff040df1700a68d555ce65c3558635 100644
--- a/cc/scheduler/scheduler.h
+++ b/cc/scheduler/scheduler.h
@@ -17,6 +17,7 @@
#include "cc/scheduler/draw_swap_readback_result.h"
#include "cc/scheduler/scheduler_settings.h"
#include "cc/scheduler/scheduler_state_machine.h"
+#include "cc/scheduler/time_source.h"
#include "cc/trees/layer_tree_host.h"
namespace cc {
@@ -47,19 +48,26 @@ class SchedulerClient {
virtual ~SchedulerClient() {}
};
-class CC_EXPORT Scheduler {
+class CC_EXPORT Scheduler : public TimeSourceClient {
public:
static scoped_ptr<Scheduler> Create(
SchedulerClient* client,
const SchedulerSettings& scheduler_settings,
int layer_tree_host_id,
- const scoped_refptr<base::SequencedTaskRunner>& impl_task_runner) {
+ const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner) {
return make_scoped_ptr(new Scheduler(
client, scheduler_settings, layer_tree_host_id, impl_task_runner));
}
virtual ~Scheduler();
+ // TimeSourceClient implementation
+ virtual void OnTimerTick() OVERRIDE;
+
+ void CommitVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval);
+ void SetEstimatedParentDrawTime(base::TimeDelta draw_time);
Sami 2014/04/08 13:46:01 Since DrawDurationEstimate() is already in Schedul
brianderson 2014/04/09 02:52:05 SetEstimatedParentDrawTime is likely to be an asyn
+
void SetCanStart();
void SetVisible(bool visible);
@@ -116,6 +124,7 @@ class CC_EXPORT Scheduler {
base::TimeTicks LastBeginImplFrameTime();
void BeginFrame(const BeginFrameArgs& args);
+ void PostBeginRetroFrame();
void BeginRetroFrame();
void BeginImplFrame(const BeginFrameArgs& args);
void OnBeginImplFrameDeadline();
@@ -134,10 +143,11 @@ class CC_EXPORT Scheduler {
}
private:
- Scheduler(SchedulerClient* client,
- const SchedulerSettings& scheduler_settings,
- int layer_tree_host_id,
- const scoped_refptr<base::SequencedTaskRunner>& impl_task_runner);
+ Scheduler(
+ SchedulerClient* client,
+ const SchedulerSettings& scheduler_settings,
+ int layer_tree_host_id,
+ const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner);
base::TimeTicks AdjustedBeginImplFrameDeadline(
const BeginFrameArgs& args,
@@ -145,6 +155,9 @@ class CC_EXPORT Scheduler {
void ScheduleBeginImplFrameDeadline(base::TimeTicks deadline);
void SetupNextBeginFrameIfNeeded();
void PostBeginRetroFrameIfNeeded();
+ void SetupNextBeginFrameWhenVSyncEnabled(bool needs_begin_frame);
+ void SetupNextBeginFrameWhenVSyncDisabled(bool needs_begin_frame);
+ void SetupPollingMechanisms(bool needs_begin_frame);
void ActivatePendingTree();
void DrawAndSwapIfPossible();
void DrawAndSwapForced();
@@ -159,14 +172,20 @@ class CC_EXPORT Scheduler {
const SchedulerSettings settings_;
SchedulerClient* client_;
int layer_tree_host_id_;
- scoped_refptr<base::SequencedTaskRunner> impl_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_;
+
+ base::TimeDelta vsync_interval_;
+ base::TimeDelta estimated_parent_draw_time_;
bool last_set_needs_begin_frame_;
bool begin_retro_frame_posted_;
-
std::deque<BeginFrameArgs> begin_retro_frame_args_;
BeginFrameArgs begin_impl_frame_args_;
+ scoped_refptr<TimeSource> time_source_for_synthetic_begin_frames_;
Sami 2014/04/08 13:46:01 Is there a way we could isolate the synthetic Begi
brianderson 2014/04/09 02:52:05 The goal was to get rid of it before, but I'm not
brianderson 2014/04/10 23:45:58 I ended up using an inner class like you originall
+ void SetupSyntheticBeginFrames();
+ BeginFrameArgs CreateSyntheticBeginFrameArgs(base::TimeTicks frame_time);
+
base::Closure begin_retro_frame_closure_;
base::Closure begin_impl_frame_deadline_closure_;
base::Closure poll_for_draw_triggers_closure_;

Powered by Google App Engine
This is Rietveld 408576698