diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/dom/ScriptedAnimationController.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/dom/ScriptedAnimationController.h')
-rw-r--r-- | Source/WebCore/dom/ScriptedAnimationController.h | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/Source/WebCore/dom/ScriptedAnimationController.h b/Source/WebCore/dom/ScriptedAnimationController.h index f2808e78d..012c25862 100644 --- a/Source/WebCore/dom/ScriptedAnimationController.h +++ b/Source/WebCore/dom/ScriptedAnimationController.h @@ -23,22 +23,24 @@ * */ -#ifndef ScriptedAnimationController_h -#define ScriptedAnimationController_h +#pragma once -#if ENABLE(REQUEST_ANIMATION_FRAME) #include "DOMTimeStamp.h" -#if USE(REQUEST_ANIMATION_FRAME_TIMER) -#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) -#include "DisplayRefreshMonitor.h" -#endif -#include "Timer.h" -#endif #include "PlatformScreen.h" #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> #include <wtf/Vector.h> +#if USE(REQUEST_ANIMATION_FRAME_TIMER) +#include "Timer.h" +#endif + +#if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) +#include "Chrome.h" +#include "ChromeClient.h" +#include "DisplayRefreshMonitorClient.h" +#endif + namespace WebCore { class Document; @@ -50,22 +52,24 @@ class ScriptedAnimationController : public RefCounted<ScriptedAnimationControlle #endif { public: - static PassRefPtr<ScriptedAnimationController> create(Document* document, PlatformDisplayID displayID) + static Ref<ScriptedAnimationController> create(Document* document, PlatformDisplayID displayID) { - return adoptRef(new ScriptedAnimationController(document, displayID)); + return adoptRef(*new ScriptedAnimationController(document, displayID)); } ~ScriptedAnimationController(); - void clearDocumentPointer() { m_document = 0; } + void clearDocumentPointer() { m_document = nullptr; } + bool requestAnimationFrameEnabled() const; typedef int CallbackId; - CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>); + CallbackId registerCallback(Ref<RequestAnimationFrameCallback>&&); void cancelCallback(CallbackId); - void serviceScriptedAnimations(double monotonicTimeNow); + void serviceScriptedAnimations(double timestamp); void suspend(); void resume(); void setThrottled(bool); + WEBCORE_EXPORT bool isThrottled() const; void windowScreenDidChange(PlatformDisplayID); @@ -76,28 +80,25 @@ private: CallbackList m_callbacks; Document* m_document; - CallbackId m_nextCallbackId; - int m_suspendCount; + CallbackId m_nextCallbackId { 0 }; + int m_suspendCount { 0 }; void scheduleAnimation(); #if USE(REQUEST_ANIMATION_FRAME_TIMER) - void animationTimerFired(Timer<ScriptedAnimationController>&); - Timer<ScriptedAnimationController> m_animationTimer; - double m_lastAnimationFrameTimeMonotonic; + void animationTimerFired(); + Timer m_animationTimer; + double m_lastAnimationFrameTimestamp { 0 }; +#endif -#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) +#if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) // Override for DisplayRefreshMonitorClient - virtual void displayRefreshFired(double timestamp) override; + void displayRefreshFired() override; + RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override; - bool m_isUsingTimer; - bool m_isThrottled; -#endif + bool m_isUsingTimer { false }; + bool m_isThrottled { false }; #endif }; -} - -#endif // ENABLE(REQUEST_ANIMATION_FRAME) - -#endif // ScriptedAnimationController_h +} // namespace WebCore |