From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/dom/ScriptedAnimationController.h | 59 ++++++++++++------------ 1 file changed, 30 insertions(+), 29 deletions(-) (limited to 'Source/WebCore/dom/ScriptedAnimationController.h') 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 #include #include +#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 create(Document* document, PlatformDisplayID displayID) + static Ref 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); + CallbackId registerCallback(Ref&&); 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&); - Timer 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 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 -- cgit v1.2.1