| Index: cc/scheduler/scheduler.h
|
| diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
|
| index 97b17b7283aaf4e357be4fd8e5726298f80c63cf..53d6b8ac569e13101b9136ebd86d415edd092a2b 100644
|
| --- a/cc/scheduler/scheduler.h
|
| +++ b/cc/scheduler/scheduler.h
|
| @@ -11,6 +11,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/cancelable_callback.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/power_monitor/power_observer.h"
|
| #include "base/time/time.h"
|
| #include "cc/base/cc_export.h"
|
| #include "cc/output/begin_frame_args.h"
|
| @@ -51,7 +52,7 @@ class SchedulerClient {
|
| virtual ~SchedulerClient() {}
|
| };
|
|
|
| -class CC_EXPORT Scheduler {
|
| +class CC_EXPORT Scheduler : public base::PowerObserver {
|
| public:
|
| static scoped_ptr<Scheduler> Create(
|
| SchedulerClient* client,
|
| @@ -64,6 +65,9 @@ class CC_EXPORT Scheduler {
|
|
|
| virtual ~Scheduler();
|
|
|
| + // base::PowerObserver method.
|
| + virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE;
|
| +
|
| const SchedulerSettings& settings() const { return settings_; }
|
|
|
| void CommitVSyncParameters(base::TimeTicks timebase,
|
| @@ -198,6 +202,8 @@ class CC_EXPORT Scheduler {
|
| bool inside_process_scheduled_actions_;
|
| SchedulerStateMachine::Action inside_action_;
|
|
|
| + bool on_battery_power_;
|
| +
|
| private:
|
| base::TimeTicks AdjustedBeginImplFrameDeadline(
|
| const BeginFrameArgs& args,
|
| @@ -216,10 +222,13 @@ class CC_EXPORT Scheduler {
|
| void SetupSyntheticBeginFrames();
|
| void BeginRetroFrame();
|
| void BeginUnthrottledFrame();
|
| + bool ShouldPostBeginImplFrameDeadline();
|
| void BeginImplFrame(const BeginFrameArgs& args);
|
| void OnBeginImplFrameDeadline();
|
| void PollForAnticipatedDrawTriggers();
|
| void PollToAdvanceCommitState();
|
| + void SetupPowerMonitoring();
|
| + void TeardownPowerMonitoring();
|
|
|
| base::TimeDelta VSyncInterval() { return vsync_interval_; }
|
|
|
|
|