Changeset 132907 in webkit


Ignore:
Timestamp:
Oct 30, 2012 7:11:28 AM (11 years ago)
Author:
noam.rosenthal@nokia.com
Message:

[Qt] Animations jump when the page is suspended
https://bugs.webkit.org/show_bug.cgi?id=100673

Reviewed by Kenneth Rohde Christiansen.

GraphicsLayerAnimations::pause() should accept time from start and not an offset.

Source/WebCore:

We need to support the "freeze" API before this can be reliably tested.
See https://bugs.webkit.org/show_bug.cgi?id=100703.

  • platform/graphics/GraphicsLayerAnimation.cpp:

(WebCore::GraphicsLayerAnimation::pause):

Source/WebKit2:

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::animationStartedTimerFired):

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:

(CoordinatedGraphicsLayer):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r132906 r132907  
     12012-10-30  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        [Qt] Animations jump when the page is suspended
     4        https://bugs.webkit.org/show_bug.cgi?id=100673
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        GraphicsLayerAnimations::pause() should accept time from start and not an offset.
     9
     10        We need to support the "freeze" API before this can be reliably tested.
     11        See https://bugs.webkit.org/show_bug.cgi?id=100703.
     12
     13        * platform/graphics/GraphicsLayerAnimation.cpp:
     14        (WebCore::GraphicsLayerAnimation::pause):
     15
    1162012-10-30  Kondapally Kalyan  <kalyan.kondapally@intel.com>
    217
  • trunk/Source/WebCore/platform/graphics/GraphicsLayerAnimation.cpp

    r132798 r132907  
    263263}
    264264
    265 void GraphicsLayerAnimation::pause(double offset)
    266 {
    267     // FIXME: should apply offset here.
     265void GraphicsLayerAnimation::pause(double time)
     266{
    268267    setState(PausedState);
    269     m_pauseTime = WTF::currentTime() - offset;
     268    m_pauseTime = time;
    270269}
    271270
  • trunk/Source/WebKit2/ChangeLog

    r132905 r132907  
     12012-10-30  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        [Qt] Animations jump when the page is suspended
     4        https://bugs.webkit.org/show_bug.cgi?id=100673
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        GraphicsLayerAnimations::pause() should accept time from start and not an offset.
     9
     10        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
     11        (WebCore::CoordinatedGraphicsLayer::addAnimation):
     12        (WebCore::CoordinatedGraphicsLayer::pauseAnimation):
     13        (WebCore::CoordinatedGraphicsLayer::animationStartedTimerFired):
     14        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
     15        (CoordinatedGraphicsLayer):
     16
    1172012-10-30  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    218
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp

    r132275 r132907  
    796796}
    797797
    798 bool CoordinatedGraphicsLayer::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double timeOffset)
     798bool CoordinatedGraphicsLayer::addAnimation(const KeyframeValueList& valueList, const IntSize& boxSize, const Animation* anim, const String& keyframesName, double delayAsNegativeTimeOffset)
    799799{
    800800    ASSERT(!keyframesName.isEmpty());
     
    809809        listsMatch = validateTransformOperations(valueList, ignoredHasBigRotation) >= 0;
    810810
    811     m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, WTF::currentTime() - timeOffset, listsMatch));
     811    m_lastAnimationStartTime = WTF::currentTime() - delayAsNegativeTimeOffset;
     812    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, m_lastAnimationStartTime, listsMatch));
    812813    m_animationStartedTimer.startOneShot(0);
    813814    didChangeAnimations();
     
    815816}
    816817
    817 void CoordinatedGraphicsLayer::pauseAnimation(const String& animationName, double timeOffset)
    818 {
    819     m_animations.pause(animationName, timeOffset);
     818void CoordinatedGraphicsLayer::pauseAnimation(const String& animationName, double time)
     819{
     820    m_animations.pause(animationName, time);
    820821    didChangeAnimations();
    821822}
     
    829830void CoordinatedGraphicsLayer::animationStartedTimerFired(Timer<CoordinatedGraphicsLayer>*)
    830831{
    831     client()->notifyAnimationStarted(this, /* DOM time */ WTF::currentTime());
     832    client()->notifyAnimationStarted(this, m_lastAnimationStartTime);
    832833}
    833834}
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h

    r132275 r132907  
    221221    Timer<CoordinatedGraphicsLayer> m_animationStartedTimer;
    222222    GraphicsLayerAnimations m_animations;
     223    double m_lastAnimationStartTime;
    223224};
    224225
Note: See TracChangeset for help on using the changeset viewer.