Changeset 57770 in webkit


Ignore:
Timestamp:
Apr 16, 2010 7:04:50 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-16 No'am Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Antti Koivisto.

[Qt] GraphicsLayer: support fill-modes
https://bugs.webkit.org/show_bug.cgi?id=36216

Remove LayoutTests/animations/fill-mode-transform.html from the skip list

  • platform/qt/Skipped:

2010-04-16 No'am Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Antti Koivisto.

[Qt] GraphicsLayer: support fill-modes
https://bugs.webkit.org/show_bug.cgi?id=36216
Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
enables a key-frame animation to go to the animation's starting point before the delay,
and/or to stay at the animation's ending point after its ended, without reverting to the default
value.
We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.

  • platform/graphics/qt/GraphicsLayerQt.cpp: (WebCore::AnimationQtBase::AnimationQtBase): (WebCore::TransformAnimationQt::~TransformAnimationQt): (WebCore::TransformAnimationQt::applyFrame): (WebCore::GraphicsLayerQt::addAnimation):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57767 r57770  
     12010-04-16  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        [Qt] GraphicsLayer: support fill-modes
     6        https://bugs.webkit.org/show_bug.cgi?id=36216
     7
     8        Remove LayoutTests/animations/fill-mode-transform.html from the skip list
     9
     10        * platform/qt/Skipped:
     11
    1122010-04-16  Dmitry Titov  <dimich@chromium.org>
    213
  • trunk/LayoutTests/platform/qt/Skipped

    r57713 r57770  
    52175217fast/multicol/hit-test-above-or-below.html
    52185218
    5219 # https://bugs.webkit.org/show_bug.cgi?id=36191
    5220 #[Qt] GraphicsLayer: fix test regressions
    5221 animations/fill-mode-transform.html
    52225219animations/simultaneous-start-left.html
    52235220# https://bugs.webkit.org/show_bug.cgi?id=37381
  • trunk/WebCore/ChangeLog

    r57769 r57770  
     12010-04-16  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        [Qt] GraphicsLayer: support fill-modes
     6        https://bugs.webkit.org/show_bug.cgi?id=36216
     7        Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
     8        enables a key-frame animation to go to the animation's starting point before the delay,
     9        and/or to stay at the animation's ending point after its ended, without reverting to the default
     10        value.
     11        We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
     12        and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.
     13
     14        * platform/graphics/qt/GraphicsLayerQt.cpp:
     15        (WebCore::AnimationQtBase::AnimationQtBase):
     16        (WebCore::TransformAnimationQt::~TransformAnimationQt):
     17        (WebCore::TransformAnimationQt::applyFrame):
     18        (WebCore::GraphicsLayerQt::addAnimation):
     19
    1202010-04-16  Gavin Barraclough  <barraclough@apple.com>
    221
  • trunk/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp

    r57744 r57770  
    996996        , m_webkitAnimation(anim)
    997997        , m_keyframesName(name)
     998        , m_fillsForwards(false)
    998999    {
    9991000    }
     
    10191020    const Animation* m_webkitAnimation;
    10201021    QString m_keyframesName;
     1022    bool m_fillsForwards;
    10211023};
    10221024
     
    11031105    ~TransformAnimationQt()
    11041106    {
    1105         // this came up during the compositing/animation LayoutTests
    1106         // when the animation dies, the transform has to go back to default
    1107         if (m_layer)
    1108             m_layer.data()->updateTransform();
     1107        if (m_fillsForwards)
     1108            setCurrentTime(1);
     1109        else
     1110            m_layer.data()->setBaseTransform(m_layer.data()->m_layer->transform());
    11091111    }
    11101112
     
    11451147        }
    11461148        m_layer.data()->setBaseTransform(transformMatrix);
     1149        if (m_fillsForwards)
     1150            m_layer.data()->m_layer->setTransform(m_layer.data()->m_baseTransform);
    11471151    }
    11481152
     
    11741178    }
    11751179
     1180    ~OpacityAnimationQt()
     1181    {
     1182        if (m_fillsForwards)
     1183            setCurrentTime(1);
     1184        else
     1185            m_layer.data()->setOpacity(m_layer.data()->m_layer->opacity());
     1186    }
    11761187    virtual void applyFrame(const qreal& fromValue, const qreal& toValue, qreal progress)
    11771188    {
     
    11841195
    11851196        m_layer.data()->setOpacity(opacity);
     1197        if (m_fillsForwards)
     1198            m_layer.data()->m_layer->setOpacity(opacity);
    11861199    }
    11871200
     
    12001213        return false;
    12011214
    1202     QAbstractAnimation* newAnim = 0;
     1215    AnimationQtBase* newAnim = 0;
    12031216
    12041217    // fixed: we might already have the Qt animation object associated with this WebCore::Animation object
     
    12251238        // we make sure WebCore::Animation and QAnimation are on the same terms
    12261239        newAnim->setLoopCount(anim->iterationCount());
     1240        newAnim->m_fillsForwards = anim->fillsForwards();
    12271241        m_impl->m_animations.append(QWeakPointer<QAbstractAnimation>(newAnim));
    12281242        QObject::connect(&m_impl->m_suspendTimer, SIGNAL(timeout()), newAnim, SLOT(resume()));
     
    12311245    // flush now or flicker...
    12321246    m_impl->flushChanges(false);
     1247
     1248    // when fill-mode is backwards/both, we set the value to 0 before the delay takes place
     1249    if (anim->fillsBackwards())
     1250        newAnim->setCurrentTime(0);
    12331251
    12341252    if (anim->delay())
Note: See TracChangeset for help on using the changeset viewer.