Title: [150162] trunk/Source/WebCore
Revision
150162
Author
[email protected]
Date
2013-05-15 17:42:50 -0700 (Wed, 15 May 2013)

Log Message

ScriptedAnimationController::setThrottled should extend MinimumAnimationInterval
https://bugs.webkit.org/show_bug.cgi?id=116193

Reviewed by Darin Adler

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::setThrottled):
(WebCore::ScriptedAnimationController::scheduleAnimation):
* dom/ScriptedAnimationController.h:
(ScriptedAnimationController):
    - Fixes for review comments.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150161 => 150162)


--- trunk/Source/WebCore/ChangeLog	2013-05-16 00:36:28 UTC (rev 150161)
+++ trunk/Source/WebCore/ChangeLog	2013-05-16 00:42:50 UTC (rev 150162)
@@ -1,3 +1,18 @@
+2013-05-15  Gavin Barraclough  <[email protected]>
+
+        ScriptedAnimationController::setThrottled should extend MinimumAnimationInterval
+        https://bugs.webkit.org/show_bug.cgi?id=116193
+
+        Reviewed by Darin Adler
+
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+        (WebCore::ScriptedAnimationController::setThrottled):
+        (WebCore::ScriptedAnimationController::scheduleAnimation):
+        * dom/ScriptedAnimationController.h:
+        (ScriptedAnimationController):
+            - Fixes for review comments.
+
 2013-05-15  Anders Carlsson  <[email protected]>
 
         Move HTTPRequest class to WebKit2

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (150161 => 150162)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2013-05-16 00:36:28 UTC (rev 150161)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2013-05-16 00:42:50 UTC (rev 150162)
@@ -56,8 +56,8 @@
     , m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
     , m_lastAnimationFrameTimeMonotonic(0)
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    , m_useTimer(false)
-    , m_throttled(false)
+    , m_isUsingTimer(false)
+    , m_isThrottled(false)
 #endif
 #endif
 {
@@ -87,7 +87,10 @@
 void ScriptedAnimationController::setThrottled(bool isThrottled)
 {
 #if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    m_throttled = isThrottled;
+    if (m_isThrottled == isThrottled)
+        return;
+
+    m_isThrottled = isThrottled;
     if (m_animationTimer.isActive()) {
         m_animationTimer.stop();
         scheduleAnimation();
@@ -180,21 +183,22 @@
 
 #if USE(REQUEST_ANIMATION_FRAME_TIMER)
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    if (!m_useTimer && !m_throttled) {
+    if (!m_isUsingTimer && !m_isThrottled) {
         if (DisplayRefreshMonitorManager::sharedManager()->scheduleAnimation(this))
             return;
 
-        m_useTimer = true;
+        m_isUsingTimer = true;
     }
 #endif
     if (m_animationTimer.isActive())
         return;
 
+    double animationInterval = MinimumAnimationInterval;
 #if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    double animationInterval = m_throttled ? MinimumThrottledAnimationInterval : MinimumAnimationInterval;
-#else
-    double animationInterval = MinimumAnimationInterval;
+    if (m_isThrottled)
+        animationInterval = MinimumThrottledAnimationInterval;
 #endif
+
     double scheduleDelay = max<double>(animationInterval - (monotonicallyIncreasingTime() - m_lastAnimationFrameTimeMonotonic), 0);
     m_animationTimer.startOneShot(scheduleDelay);
 #else

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (150161 => 150162)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.h	2013-05-16 00:36:28 UTC (rev 150161)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h	2013-05-16 00:42:50 UTC (rev 150162)
@@ -90,8 +90,8 @@
     // Override for DisplayRefreshMonitorClient
     virtual void displayRefreshFired(double timestamp);
 
-    bool m_useTimer;
-    bool m_throttled;
+    bool m_isUsingTimer;
+    bool m_isThrottled;
 #endif
 #endif
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to