summaryrefslogtreecommitdiffstats
path: root/cc/test/scheduler_test_common.h
diff options
context:
space:
mode:
authorskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 17:10:56 +0000
committerskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-12 17:10:56 +0000
commitc7480aff12d1133ab4216fa6580e2edbef4d7078 (patch)
tree434dfe820371e751e9fb2e686ee0f72c19a61443 /cc/test/scheduler_test_common.h
parent8426f3aaa2ba2fe446512c4dbcd7bcf3b4c7eb4a (diff)
downloadchromium_src-c7480aff12d1133ab4216fa6580e2edbef4d7078.zip
chromium_src-c7480aff12d1133ab4216fa6580e2edbef4d7078.tar.gz
chromium_src-c7480aff12d1133ab4216fa6580e2edbef4d7078.tar.bz2
Revert 205750 "cc: Emulate BeginFrame in OutputSurfaces that don..."
> cc: Emulate BeginFrame in OutputSurfaces that don't support it natively > > This will allow us to avoid having two different code paths > in the Scheduler. It also allows us to more easily remove the > VSyncTimeSource and FrameRateController from the Scheduler. > > This patch instantiates the FrameRateController inside of > OutputSurface for now, but the FrameRateController could be > removed in future patches. > > BUG=245920 > BUG=243497 > > Review URL: https://chromiumcodereview.appspot.com/15836005 TBR=brianderson@chromium.org Review URL: https://codereview.chromium.org/16679010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/scheduler_test_common.h')
-rw-r--r--cc/test/scheduler_test_common.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h
index 8834e62..b3b2c2d 100644
--- a/cc/test/scheduler_test_common.h
+++ b/cc/test/scheduler_test_common.h
@@ -62,6 +62,36 @@ class FakeThread : public cc::Thread {
bool run_pending_task_on_overwrite_;
};
+class FakeTimeSource : public cc::TimeSource {
+ public:
+ FakeTimeSource() : active_(false), client_(0) {}
+
+ virtual void SetClient(cc::TimeSourceClient* client) OVERRIDE;
+ virtual void SetActive(bool b) OVERRIDE;
+ virtual bool Active() const OVERRIDE;
+ virtual void SetTimebaseAndInterval(base::TimeTicks timebase,
+ base::TimeDelta interval) OVERRIDE {}
+ virtual base::TimeTicks LastTickTime() OVERRIDE;
+ virtual base::TimeTicks NextTickTime() OVERRIDE;
+
+ void Tick() {
+ ASSERT_TRUE(active_);
+ if (client_)
+ client_->OnTimerTick();
+ }
+
+ void SetNextTickTime(base::TimeTicks next_tick_time) {
+ next_tick_time_ = next_tick_time;
+ }
+
+ protected:
+ virtual ~FakeTimeSource() {}
+
+ bool active_;
+ base::TimeTicks next_tick_time_;
+ cc::TimeSourceClient* client_;
+};
+
class FakeDelayBasedTimeSource : public cc::DelayBasedTimeSource {
public:
static scoped_refptr<FakeDelayBasedTimeSource> Create(