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

Unified Diff: cc/scheduler/scheduler.h

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Created 7 years, 7 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 aec0cdf2b56dcb4e801f41af44f165831ae3205d..3915d8e191d2970a7f6c9b5090246e50a87178b5 100644
--- a/cc/scheduler/scheduler.h
+++ b/cc/scheduler/scheduler.h
@@ -33,6 +33,7 @@ struct ScheduledActionDrawAndSwapResult {
class SchedulerClient {
public:
+ virtual void SetNeedsBeginFrameOnImplThread(bool enable) = 0;
virtual void ScheduledActionSendBeginFrameToMainThread() = 0;
virtual ScheduledActionDrawAndSwapResult
ScheduledActionDrawAndSwapIfPossible() = 0;
@@ -49,14 +50,13 @@ class SchedulerClient {
virtual ~SchedulerClient() {}
};
-class CC_EXPORT Scheduler : FrameRateControllerClient {
+class CC_EXPORT Scheduler {
public:
static scoped_ptr<Scheduler> Create(
SchedulerClient* client,
- scoped_ptr<FrameRateController> frame_rate_controller,
- const SchedulerSettings& scheduler_settings) {
- return make_scoped_ptr(new Scheduler(
- client, frame_rate_controller.Pass(), scheduler_settings));
+ const SchedulerSettings& scheduler_settings,
+ Thread* thread) {
+ return make_scoped_ptr(new Scheduler(client, scheduler_settings, thread));
}
virtual ~Scheduler();
@@ -86,13 +86,6 @@ class CC_EXPORT Scheduler : FrameRateControllerClient {
void FinishCommit();
void BeginFrameAbortedByMainThread();
- void SetMaxFramesPending(int max);
- int MaxFramesPending() const;
- int NumFramesPendingForTesting() const;
-
- void SetSwapBuffersCompleteSupported(bool supported);
- void DidSwapBuffersComplete();
-
void DidLoseOutputSurface();
void DidCreateAndInitializeOutputSurface();
bool HasInitializedOutputSurface() const {
@@ -104,28 +97,34 @@ class CC_EXPORT Scheduler : FrameRateControllerClient {
bool WillDrawIfNeeded() const;
- void SetTimebaseAndInterval(base::TimeTicks timebase,
- base::TimeDelta interval);
-
base::TimeTicks AnticipatedDrawTime();
base::TimeTicks LastBeginFrameOnImplThreadTime();
- // FrameRateControllerClient implementation
- virtual void BeginFrame(bool throttled) OVERRIDE;
+ void BeginFrame(base::TimeTicks frame_time);
+ void BeginFrameRetry();
std::string StateAsStringForTesting() { return state_machine_.ToString(); }
private:
Scheduler(SchedulerClient* client,
- scoped_ptr<FrameRateController> frame_rate_controller,
- const SchedulerSettings& scheduler_settings);
+ const SchedulerSettings& scheduler_settings,
+ Thread* thread);
+ void DidSwapBuffers();
+ void SetNeedsBeginFrameIfNeeded();
void ProcessScheduledActions();
const SchedulerSettings settings_;
SchedulerClient* client_;
- scoped_ptr<FrameRateController> frame_rate_controller_;
+
+ base::WeakPtrFactory<Scheduler> weak_factory_;
brianderson 2013/06/01 04:30:29 I'll probably move these into the StateMachine so
+ Thread* thread_;
+ bool last_set_needs_begin_frame_;
+ int pending_begin_frames_;
Sami 2013/06/03 17:30:33 Does it ever make sense to have more than one of t
brianderson 2013/06/03 18:51:40 Currently, it does not make sense: one BeginFrame
+ base::TimeTicks last_begin_frame_time_;
+ base::TimeDelta interval_;
+
SchedulerStateMachine state_machine_;
bool inside_process_scheduled_actions_;

Powered by Google App Engine
This is Rietveld 408576698