summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h')
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
index 99795db81..61f637ad7 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
@@ -44,9 +44,17 @@ public:
virtual void setClient(CCTimeSourceClient* client) OVERRIDE { m_client = client; }
+ // CCTimeSource implementation
+ virtual void setTimebaseAndInterval(double timebase, double intervalSeconds) OVERRIDE;
+
virtual void setActive(bool) OVERRIDE;
virtual bool active() const OVERRIDE { return m_state != STATE_INACTIVE; }
+ // Get the last and next tick times.
+ // If not active, nextTickTime will return 0.
+ virtual double lastTickTime() OVERRIDE;
+ virtual double nextTickTime() OVERRIDE;
+
// CCTimerClient implementation.
virtual void onTimerFired() OVERRIDE;
@@ -62,10 +70,26 @@ protected:
STATE_STARTING,
STATE_ACTIVE,
};
+
+ struct Parameters {
+ Parameters(double interval, double tickTarget)
+ : interval(interval), tickTarget(tickTarget)
+ { }
+ double interval;
+ double tickTarget;
+ };
+
CCTimeSourceClient* m_client;
bool m_hasTickTarget;
- double m_intervalSeconds;
- double m_tickTarget;
+ double m_lastTickTime;
+
+ // m_currentParameters should only be written by postNextTickTask.
+ // m_nextParameters will take effect on the next call to postNextTickTask.
+ // Maintaining a pending set of parameters allows nextTickTime() to always
+ // reflect the actual time we expect onTimerFired to be called.
+ Parameters m_currentParameters;
+ Parameters m_nextParameters;
+
State m_state;
CCThread* m_thread;
CCTimer m_timer;