Changeset 40876 in webkit


Ignore:
Timestamp:
Feb 11, 2009 3:18:56 PM (15 years ago)
Author:
Simon Fraser
Message:

2009-02-11 Simon Fraser <Simon Fraser>

Reviewed by Dave Hyatt

https://bugs.webkit.org/show_bug.cgi?id=23862

Add a bit on RenderStyle that gets set when running accelerated
transitions of transform or opacity. These ensure that styles
compare as different during the transition, so that interruption
can be detected reliably.

Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r40875 r40876  
     12009-02-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23862
     6       
     7        Add a bit on RenderStyle that gets set when running accelerated
     8        transitions of transform or opacity. These ensure that styles
     9        compare as different during the transition, so that interruption
     10        can be detected reliably.
     11
     12        * page/animation/ImplicitAnimation.cpp:
     13        (WebCore::ImplicitAnimation::animate):
     14        * rendering/style/RenderStyle.h:
     15        (WebCore::InheritedFlags::isRunningAcceleratedAnimation):
     16        (WebCore::InheritedFlags::setIsRunningAcceleratedAnimation):
     17        * rendering/style/StyleRareNonInheritedData.cpp:
     18        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
     19        (WebCore::StyleRareNonInheritedData::operator==):
     20        * rendering/style/StyleRareNonInheritedData.h:
     21
    1222009-02-11  David Hyatt  <hyatt@apple.com>
    223
  • trunk/WebCore/page/animation/ImplicitAnimation.cpp

    r40843 r40876  
    8080
    8181    bool needsAnim = blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0));
     82    // FIXME: we also need to detect cases where we have to software animate for other reasons,
     83    // such as a child using inheriting the transform. https://bugs.webkit.org/show_bug.cgi?id=23902
    8284    if (needsAnim)
    8385        setAnimating();
     86    else {
     87#if USE(ACCELERATED_COMPOSITING)
     88        // If we are running an accelerated animation, set a flag in the style which causes the style
     89        // to compare as different to any other style. This ensures that changes to the property
     90        // that is animating are correctly detected during the animation (e.g. when a transition
     91        // gets interrupted).
     92        animatedStyle->setIsRunningAcceleratedAnimation();
     93#endif
     94    }
    8495
    8596    // Fire the start timeout if needed
  • trunk/WebCore/rendering/style/RenderStyle.h

    r40868 r40876  
    658658    // return the first found Animation (including 'all' transitions)
    659659    const Animation* transitionForProperty(int property) const;
     660
     661#if USE(ACCELERATED_COMPOSITING)
     662    // When set, this ensures that styles compare as different. Used during accelerated animations.
     663    bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
     664#endif
    660665
    661666    int lineClamp() const { return rareNonInheritedData->lineClamp; }
     
    953958    void adjustAnimations();
    954959    void adjustTransitions();
     960
     961#if USE(ACCELERATED_COMPOSITING)
     962    void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
     963#endif
    955964
    956965    void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
  • trunk/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r40734 r40876  
    4343    , m_appearance(RenderStyle::initialAppearance())
    4444    , m_borderFit(RenderStyle::initialBorderFit())
     45#if USE(ACCELERATED_COMPOSITING)
     46    , m_runningAcceleratedAnimation(false)
     47#endif
    4548    , m_boxShadow(0)
    4649    , m_animations(0)
     
    7073    , m_appearance(o.m_appearance)
    7174    , m_borderFit(o.m_borderFit)
     75#if USE(ACCELERATED_COMPOSITING)
     76    , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
     77#endif
    7278    , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0)
    7379    , m_boxReflect(o.m_boxReflect)
     
    118124        && m_appearance == o.m_appearance
    119125        && m_borderFit == o.m_borderFit
     126#if USE(ACCELERATED_COMPOSITING)
     127        && !m_runningAcceleratedAnimation && !o.m_runningAcceleratedAnimation
     128#endif
    120129        && shadowDataEquivalent(o)
    121130        && reflectionDataEquivalent(o)
  • trunk/WebCore/rendering/style/StyleRareNonInheritedData.h

    r40734 r40876  
    9898    unsigned m_appearance : 6; // EAppearance
    9999    unsigned m_borderFit : 1; // EBorderFit
     100#if USE(ACCELERATED_COMPOSITING)
     101    bool m_runningAcceleratedAnimation : 1;
     102#endif   
    100103    OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
    101104   
Note: See TracChangeset for help on using the changeset viewer.