summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom/ScriptedAnimationController.h
diff options
context:
space:
mode:
authorYida Wang <yidaw@codeaurora.org>2012-08-23 12:51:00 -0400
committerSteve Kondik <shade@chemlab.org>2013-01-20 18:38:31 -0800
commit77ab7f788fa2de43390a0ddb447c94a191284e88 (patch)
treeaa2021d922d649581c1473ee21cb509e0eb236ea /Source/WebCore/dom/ScriptedAnimationController.h
parent70f026a42cf1bee061389fa6ce790ea1186f0703 (diff)
downloadexternal_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.zip
external_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.tar.gz
external_webkit-77ab7f788fa2de43390a0ddb447c94a191284e88.tar.bz2
Implement requestAnimationFrame
Cherry-pick from webkit-org branch on Code Aurora Forum: requestAnimationFrame doesn't throttle on Mac https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=d9dca741b4762c433ae18f7a1bc59a3a81861fc8 Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=f0909a46fa167c84062c63caffef340a6054bc1e Rename webkitCancelRequestAnimationFrame to webkitCancelAnimationFrame to match spec change https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=cd5d11d662d638b3e4dfda33f23cda907f007f12 Remove partially implemented per-Element visibility checks from requestAnimationFrame logic https://www.codeaurora.org/gitweb/quic/la/?p=platform/external/webkit.git;a=commit;h=9fb90af3cebd0e595990cded0941d230cf77dcc1 (cherry picked from commit 47ff59a279eab9ae5dd1fd17ce7057431750a0b5) Change-Id: I7e77200006bb0c4cd4b4209082296c425bd207c1
Diffstat (limited to 'Source/WebCore/dom/ScriptedAnimationController.h')
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/WebCore/dom/ScriptedAnimationController.h b/Source/WebCore/dom/ScriptedAnimationController.h
index 7141968..f6f06a9 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.h
+++ b/Source/WebCore/dom/ScriptedAnimationController.h
@@ -28,6 +28,9 @@
#if ENABLE(REQUEST_ANIMATION_FRAME)
#include "DOMTimeStamp.h"
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+#include "Timer.h"
+#endif
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -36,7 +39,6 @@
namespace WebCore {
class Document;
-class Element;
class RequestAnimationFrameCallback;
class ScriptedAnimationController {
@@ -49,7 +51,7 @@ public:
typedef int CallbackId;
- CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>, Element*);
+ CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>);
void cancelCallback(CallbackId);
void serviceScriptedAnimations(DOMTimeStamp);
@@ -58,12 +60,21 @@ public:
private:
explicit ScriptedAnimationController(Document*);
+
typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList;
CallbackList m_callbacks;
Document* m_document;
CallbackId m_nextCallbackId;
int m_suspendCount;
+
+ void scheduleAnimation();
+
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+ void animationTimerFired(Timer<ScriptedAnimationController>*);
+ Timer<ScriptedAnimationController> m_animationTimer;
+ double m_lastAnimationFrameTime;
+#endif
};
}