Changeset 200164 in webkit


Ignore:
Timestamp:
Apr 27, 2016 6:33:14 PM (8 years ago)
Author:
Simon Fraser
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):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200163 r200164  
     12016-04-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        CSS and SVG animations should run at 60fps
     4        https://bugs.webkit.org/show_bug.cgi?id=157113
     5        rdar://problem/24337280
     6        rdar://problem/24337328
     7
     8        Reviewed by Dean Jackson.
     9
     10        For both CSS and SVG animations we used a 0.025s frame interval, which translates to
     11        40fps. That caused these animations to look extra janky compared with accelerated
     12        animations.
     13
     14        So use a 16.667ms frame interval for both.
     15
     16        Tested by content-animation benchmark tests.
     17
     18        * page/animation/AnimationController.cpp:
     19        * svg/animation/SMILTime.h:
     20        * svg/animation/SMILTimeContainer.cpp:
     21        (WebCore::SMILTimeContainer::updateAnimations):
     22        * svg/animation/SVGSMILElement.cpp:
     23        (WebCore::SVGSMILElement::calculateNextProgressTime):
     24
    1252016-04-27  Brady Eidson  <beidson@apple.com>
    226
  • trunk/Source/WebCore/page/animation/AnimationController.cpp

    r200098 r200164  
    4949namespace WebCore {
    5050
    51 static const double cAnimationTimerDelay = 0.025;
     51static const double cAnimationTimerDelay = 1.0 / 60;
    5252static const double cBeginAnimationUpdateTimeNotSet = -1;
    5353
  • trunk/Source/WebCore/svg/animation/SMILTime.h

    r167477 r200164  
    3131
    3232namespace WebCore {
     33
     34const double SMILAnimationFrameDelay = 1.0 / 60;
    3335
    3436class SMILTime {
  • trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp

    r190890 r200164  
    3636namespace WebCore {
    3737
    38 static const double animationFrameDelay = 0.025;
    39 
    4038SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
    4139    : m_beginTime(0)
     
    310308        m_preventScheduledAnimationsChanges = false;
    311309#endif
    312         startTimer(earliestFireTime, animationFrameDelay);
     310        startTimer(earliestFireTime, SMILAnimationFrameDelay);
    313311        return;
    314312    }
     
    322320#endif
    323321
    324     startTimer(earliestFireTime, animationFrameDelay);
    325 }
    326 
    327 }
     322    startTimer(earliestFireTime, SMILAnimationFrameDelay);
     323}
     324
     325}
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r197563 r200164  
    10431043            return m_intervalEnd;
    10441044        }
    1045         return elapsed + 0.025;
     1045        return elapsed + SMILAnimationFrameDelay;
    10461046    }
    10471047    return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved();
Note: See TracChangeset for help on using the changeset viewer.