Title: [200164] trunk/Source/WebCore
Revision
200164
Author
[email protected]
Date
2016-04-27 18:33:14 -0700 (Wed, 27 Apr 2016)

Log Message

CSS and SVG animations should run at 60fps
https://bugs.webkit.org/show_bug.cgi?id=157113
rdar://problem/24337280
rdar://problem/24337328

Reviewed by Dean Jackson.

For both CSS and SVG animations we used a 0.025s frame interval, which translates to
40fps. That caused these animations to look extra janky compared with accelerated
animations.

So use a 16.667ms frame interval for both.

Tested by content-animation benchmark tests.

* page/animation/AnimationController.cpp:
* svg/animation/SMILTime.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200163 => 200164)


--- trunk/Source/WebCore/ChangeLog	2016-04-28 01:16:28 UTC (rev 200163)
+++ trunk/Source/WebCore/ChangeLog	2016-04-28 01:33:14 UTC (rev 200164)
@@ -1,3 +1,27 @@
+2016-04-27  Simon Fraser  <[email protected]>
+
+        CSS and SVG animations should run at 60fps
+        https://bugs.webkit.org/show_bug.cgi?id=157113
+        rdar://problem/24337280
+        rdar://problem/24337328
+
+        Reviewed by Dean Jackson.
+
+        For both CSS and SVG animations we used a 0.025s frame interval, which translates to
+        40fps. That caused these animations to look extra janky compared with accelerated
+        animations.
+
+        So use a 16.667ms frame interval for both.
+
+        Tested by content-animation benchmark tests.
+
+        * page/animation/AnimationController.cpp:
+        * svg/animation/SMILTime.h:
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::updateAnimations):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::calculateNextProgressTime):
+
 2016-04-27  Brady Eidson  <[email protected]>
 
         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.

Modified: trunk/Source/WebCore/page/animation/AnimationController.cpp (200163 => 200164)


--- trunk/Source/WebCore/page/animation/AnimationController.cpp	2016-04-28 01:16:28 UTC (rev 200163)
+++ trunk/Source/WebCore/page/animation/AnimationController.cpp	2016-04-28 01:33:14 UTC (rev 200164)
@@ -48,7 +48,7 @@
 
 namespace WebCore {
 
-static const double cAnimationTimerDelay = 0.025;
+static const double cAnimationTimerDelay = 1.0 / 60;
 static const double cBeginAnimationUpdateTimeNotSet = -1;
 
 class AnimationPrivateUpdateBlock {

Modified: trunk/Source/WebCore/svg/animation/SMILTime.h (200163 => 200164)


--- trunk/Source/WebCore/svg/animation/SMILTime.h	2016-04-28 01:16:28 UTC (rev 200163)
+++ trunk/Source/WebCore/svg/animation/SMILTime.h	2016-04-28 01:33:14 UTC (rev 200164)
@@ -31,6 +31,8 @@
 
 namespace WebCore {
 
+const double SMILAnimationFrameDelay = 1.0 / 60;
+
 class SMILTime {
 public:
     SMILTime() : m_time(0) { }

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp (200163 => 200164)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2016-04-28 01:16:28 UTC (rev 200163)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2016-04-28 01:33:14 UTC (rev 200164)
@@ -35,8 +35,6 @@
 
 namespace WebCore {
 
-static const double animationFrameDelay = 0.025;
-
 SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner) 
     : m_beginTime(0)
     , m_pauseTime(0)
@@ -309,7 +307,7 @@
 #ifndef NDEBUG
         m_preventScheduledAnimationsChanges = false;
 #endif
-        startTimer(earliestFireTime, animationFrameDelay);
+        startTimer(earliestFireTime, SMILAnimationFrameDelay);
         return;
     }
 
@@ -321,7 +319,7 @@
     m_preventScheduledAnimationsChanges = false;
 #endif
 
-    startTimer(earliestFireTime, animationFrameDelay);
+    startTimer(earliestFireTime, SMILAnimationFrameDelay);
 }
 
 }

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (200163 => 200164)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2016-04-28 01:16:28 UTC (rev 200163)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2016-04-28 01:33:14 UTC (rev 200164)
@@ -1042,7 +1042,7 @@
                 return repeatingDurationEnd;
             return m_intervalEnd;
         } 
-        return elapsed + 0.025;
+        return elapsed + SMILAnimationFrameDelay;
     }
     return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to