Changeset 208033 in webkit


Ignore:
Timestamp:
Oct 27, 2016 10:34:34 PM (8 years ago)
Author:
Simon Fraser
Message:

Remove RenderStyle::isRunningAcceleratedAnimation()
https://bugs.webkit.org/show_bug.cgi?id=164109

Reviewed by David Hyatt.

RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
has to manually get the animated style.

The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
accelerated transitions seems to work fine without it, so remove it.

  • page/animation/ImplicitAnimation.cpp:

(WebCore::ImplicitAnimation::animate):

  • page/animation/KeyframeAnimation.cpp:

(WebCore::KeyframeAnimation::animate):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::currentTransform):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
(WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.

  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):

  • rendering/style/StyleRareNonInheritedData.h:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208032 r208033  
     12016-10-27  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove RenderStyle::isRunningAcceleratedAnimation()
     4        https://bugs.webkit.org/show_bug.cgi?id=164109
     5
     6        Reviewed by David Hyatt.
     7
     8        RenderStyle::isRunningAcceleratedAnimation() was added in r40876 to handle interrupted
     9        accelerated transitions, and to allow RenderLayer::currentTransform() to know when it
     10        has to manually get the animated style.
     11       
     12        The latter can now use isRunningAcceleratedAnimationOnRenderer(), and interrupting
     13        accelerated transitions seems to work fine without it, so remove it.
     14
     15        * page/animation/ImplicitAnimation.cpp:
     16        (WebCore::ImplicitAnimation::animate):
     17        * page/animation/KeyframeAnimation.cpp:
     18        (WebCore::KeyframeAnimation::animate):
     19        * rendering/RenderLayer.cpp:
     20        (WebCore::RenderLayer::currentTransform):
     21        * rendering/style/RenderStyle.h:
     22        (WebCore::RenderStyle::isRunningAcceleratedAnimation): Deleted.
     23        (WebCore::RenderStyle::setIsRunningAcceleratedAnimation): Deleted.
     24        * rendering/style/StyleRareNonInheritedData.cpp:
     25        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     26        (WebCore::StyleRareNonInheritedData::operator==):
     27        * rendering/style/StyleRareNonInheritedData.h:
     28
    1292016-10-27  Myles C. Maxfield  <mmaxfield@apple.com>
    230
  • trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp

    r205818 r208033  
    8080        animatedStyle = RenderStyle::clonePtr(*targetStyle);
    8181
    82     bool needsAnim = CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.get(), m_toStyle.get(), progress());
     82    CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.get(), m_toStyle.get(), progress());
    8383    // FIXME: we also need to detect cases where we have to software animate for other reasons,
    8484    // such as a child using inheriting the transform. https://bugs.webkit.org/show_bug.cgi?id=23902
    85     if (!needsAnim) {
    86         // If we are running an accelerated animation, set a flag in the style which causes the style
    87         // to compare as different to any other style. This ensures that changes to the property
    88         // that is animating are correctly detected during the animation (e.g. when a transition
    89         // gets interrupted).
    90         // FIXME: still need this hack?
    91         animatedStyle->setIsRunningAcceleratedAnimation();
    92     }
    9385
    9486    // Fire the start timeout if needed
  • trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp

    r208025 r208033  
    177177        fetchIntervalEndpointsForProperty(propertyID, fromStyle, toStyle, progress);
    178178
    179         bool needsAnim = CSSPropertyAnimation::blendProperties(this, propertyID, animatedStyle.get(), fromStyle, toStyle, progress);
    180         if (!needsAnim)
    181             // If we are running an accelerated animation, set a flag in the style
    182             // to indicate it. This can be used to make sure we get an updated
    183             // style for hit testing, etc.
    184             // FIXME: still need this?
    185             animatedStyle->setIsRunningAcceleratedAnimation();
     179        CSSPropertyAnimation::blendProperties(this, propertyID, animatedStyle.get(), fromStyle, toStyle, progress);
    186180    }
    187181   
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r208025 r208033  
    996996   
    997997    RenderBox* box = renderBox();
    998     ASSERT(box);
    999     // FIXME: replace with call to AnimationController::isRunningAcceleratedAnimationOnRenderer() and remove RenderStyle::isRunningAcceleratedAnimation().
    1000     if (renderer().style().isRunningAcceleratedAnimation()) {
     998
     999    if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused)) {
    10011000        TransformationMatrix currTransform;
    10021001        FloatRect pixelSnappedBorderRect = snapRectToDevicePixels(box->borderBoxRect(), box->document().deviceScaleFactor());
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r208026 r208033  
    11211121    PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
    11221122   
    1123     // When set, this ensures that styles compare as different. Used during accelerated animations.
    1124     bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
    1125 
    11261123    LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
    11271124    const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
     
    16951692    void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
    16961693
    1697     void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
    1698 
    16991694    void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
    17001695    void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r208026 r208033  
    9797    , m_textCombine(RenderStyle::initialTextCombine())
    9898    , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
    99     , m_runningAcceleratedAnimation(false)
    10099    , m_aspectRatioType(RenderStyle::initialAspectRatioType())
    101100#if ENABLE(CSS_COMPOSITING)
     
    195194    , m_textCombine(o.m_textCombine)
    196195    , m_textDecorationStyle(o.m_textDecorationStyle)
    197     , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
    198196    , m_aspectRatioType(o.m_aspectRatioType)
    199197#if ENABLE(CSS_COMPOSITING)
     
    304302        && m_scrollSnapType == o.m_scrollSnapType
    305303#endif
    306         && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
    307304#if ENABLE(CSS_COMPOSITING)
    308305        && m_effectiveBlendMode == o.m_effectiveBlendMode
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r208026 r208033  
    208208    unsigned m_textDecorationStyle : 3; // TextDecorationStyle
    209209
    210     unsigned m_runningAcceleratedAnimation : 1;
    211 
    212210    unsigned m_aspectRatioType : 2;
    213211
Note: See TracChangeset for help on using the changeset viewer.