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

Unified Diff: trunk/src/cc/scheduler/scheduler.h

Issue 17204002: Revert 206020 "cc: Emulate BeginFrame in OutputSurfaces that don..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « trunk/src/cc/scheduler/frame_rate_controller_unittest.cc ('k') | trunk/src/cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/scheduler/scheduler.h
===================================================================
--- trunk/src/cc/scheduler/scheduler.h (revision 206654)
+++ trunk/src/cc/scheduler/scheduler.h (working copy)
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "cc/base/cc_export.h"
+#include "cc/scheduler/frame_rate_controller.h"
#include "cc/scheduler/scheduler_settings.h"
#include "cc/scheduler/scheduler_state_machine.h"
#include "cc/trees/layer_tree_host.h"
@@ -32,7 +33,6 @@
class SchedulerClient {
public:
- virtual void SetNeedsBeginFrameOnImplThread(bool enable) = 0;
virtual void ScheduledActionSendBeginFrameToMainThread() = 0;
virtual ScheduledActionDrawAndSwapResult
ScheduledActionDrawAndSwapIfPossible() = 0;
@@ -50,12 +50,14 @@
virtual ~SchedulerClient() {}
};
-class CC_EXPORT Scheduler {
+class CC_EXPORT Scheduler : FrameRateControllerClient {
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, scheduler_settings));
+ return make_scoped_ptr(new Scheduler(
+ client, frame_rate_controller.Pass(), scheduler_settings));
}
virtual ~Scheduler();
@@ -85,6 +87,12 @@
void FinishCommit();
void BeginFrameAbortedByMainThread();
+ void SetMaxFramesPending(int max);
+ int MaxFramesPending() const;
+ int NumFramesPendingForTesting() const;
+
+ void DidSwapBuffersComplete();
+
void DidLoseOutputSurface();
void DidCreateAndInitializeOutputSurface();
bool HasInitializedOutputSurface() const {
@@ -96,32 +104,28 @@
bool WillDrawIfNeeded() const;
+ void SetTimebaseAndInterval(base::TimeTicks timebase,
+ base::TimeDelta interval);
+
base::TimeTicks AnticipatedDrawTime();
base::TimeTicks LastBeginFrameOnImplThreadTime();
- void BeginFrame(base::TimeTicks frame_time);
+ // FrameRateControllerClient implementation
+ virtual void BeginFrame(bool throttled) OVERRIDE;
std::string StateAsStringForTesting() { return state_machine_.ToString(); }
private:
Scheduler(SchedulerClient* client,
+ scoped_ptr<FrameRateController> frame_rate_controller,
const SchedulerSettings& scheduler_settings);
- void SetupNextBeginFrameIfNeeded();
- void DrawAndSwapIfPossible();
- void DrawAndSwapForced();
void ProcessScheduledActions();
const SchedulerSettings settings_;
SchedulerClient* client_;
-
- base::WeakPtrFactory<Scheduler> weak_factory_;
- bool last_set_needs_begin_frame_;
- bool has_pending_begin_frame_;
- base::TimeTicks last_begin_frame_time_;
- base::TimeDelta interval_;
-
+ scoped_ptr<FrameRateController> frame_rate_controller_;
SchedulerStateMachine state_machine_;
bool inside_process_scheduled_actions_;
« no previous file with comments | « trunk/src/cc/scheduler/frame_rate_controller_unittest.cc ('k') | trunk/src/cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698