⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268746 in webkit


Ignore:
Timestamp:
Oct 20, 2020, 10:34:38 AM (6 years ago)
Author:
graouts@webkit.org
Message:

REGRESSION(r268615): some accelerated transform tests are failing
https://bugs.webkit.org/show_bug.cgi?id=217851
<rdar://problem/70394402>

Reviewed by Dean Jackson.

Source/WebCore:

When we added support for accelerated individual transform properties animations, we added
the notion of base transform animations which are used to set the base value of any
transform-related property that is not animated.

Those animations were defined to start as early as possible, assuming that a very small value
after 0s was as early as possible. However, it's possible that other animations start with a
negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
is smaller than that delay. This means that if the machine had been booted for less time than
an accelerated animation's delay, the base transform animation wouldn't overlap.

We now ensure that those base transform animations start as early as the earliest animation
that is being committed in a call to GraphicsLayerCA::updateAnimations().

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::setAnimationOnLayer):

  • platform/graphics/ca/GraphicsLayerCA.h:

(WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):

LayoutTests:

Remove flaky epectations for affected tests and skip tests on Windows where failures remain.

  • TestExpectations:
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268745 r268746  
     12020-10-20  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION(r268615): some accelerated transform tests are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=217851
     5        <rdar://problem/70394402>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Remove flaky epectations for affected tests and skip tests on Windows where failures remain.
     10
     11        * TestExpectations:
     12        * platform/mac/TestExpectations:
     13        * platform/win/TestExpectations:
     14
    1152020-10-20  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/LayoutTests/TestExpectations

    r268734 r268746  
    45194519fast/layoutformattingcontext/ [ ImageOnlyFailure ]
    45204520webkit.org/b/217054 fast/layoutformattingcontext/horizontal-sizing-with-trailing-letter-spacing.html [ Skip ]
    4521 
    4522 webkit.org/b/217851 transitions/interrupted-transition-hardware.html [ Pass Failure ]
    4523 webkit.org/b/217851 webanimations/accelerated-transform-related-animation-property-order.html [ Pass Failure ]
    4524 webkit.org/b/217851 webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Pass Failure ]
    4525 webkit.org/b/217851 webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Pass Failure ]
    4526 webkit.org/b/217851 webanimations/accelerated-translate-animation-with-transform.html [ Pass Failure ]
    4527 webkit.org/b/217851 webanimations/accelerated-translate-animation.html [ Pass Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r268713 r268746  
    22472247webkit.org/b/217620 inspector/audit/basic-async.htm [ Pass Timeout ]
    22482248
    2249 # These are failing on Mojave due to an error in the way CA animations are applied.
    2250 # https://bugs.webkit.org/show_bug.cgi?id=217842
    2251 [ Mojave ] transitions/interrupted-transition-hardware.html [ Pass Failure ]
    2252 [ Mojave ] webanimations/accelerated-transform-related-animation-property-order.html [ Pass Failure ]
    2253 [ Mojave ] webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Pass Failure ]
    2254 [ Mojave ] webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Pass Failure ]
    2255 [ Mojave ] webanimations/accelerated-translate-animation-with-transform.html [ Pass Failure ]
    2256 [ Mojave ] webanimations/accelerated-translate-animation.html [ Pass Failure ]
    2257 
    22582249webkit.org/b/217931 imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/moving-between-documents/before-prepare-createHTMLDocument-success-empty-src-module.html [ Pass Failure ]
    22592250
  • trunk/LayoutTests/platform/win/TestExpectations

    r268692 r268746  
    45874587webkit.org/b/217812 transforms/2d/translate-change-composited.html [ Skip ]
    45884588webkit.org/b/217812 transforms/2d/rotate-composited.html [ Skip ]
     4589webkit.org/b/217812 webanimations/accelerated-transform-related-animation-property-order.html [ Skip ]
     4590webkit.org/b/217812 webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Skip ]
     4591webkit.org/b/217812 webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Skip ]
     4592webkit.org/b/217812 webanimations/accelerated-translate-animation-with-transform.html [ Skip ]
     4593webkit.org/b/217812 webanimations/accelerated-translate-animation.html [ Skip ]
    45894594
    45904595webkit.org/b/217922 [ Release ] animations/additive-transform-animations.html [ ImageOnlyFailure ]
    45914596webkit.org/b/217922 animations/needs-layout.html [ ImageOnlyFailure ]
    45924597webkit.org/b/217922 fast/animation/animation-mixed-transform-crash.html [ ImageOnlyFailure ]
    4593 
  • trunk/Source/WebCore/ChangeLog

    r268745 r268746  
     12020-10-20  Antoine Quint  <graouts@webkit.org>
     2
     3        REGRESSION(r268615): some accelerated transform tests are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=217851
     5        <rdar://problem/70394402>
     6
     7        Reviewed by Dean Jackson.
     8
     9        When we added support for accelerated individual transform properties animations, we added
     10        the notion of base transform animations which are used to set the base value of any
     11        transform-related property that is not animated.
     12
     13        Those animations were defined to start as early as possible, assuming that a very small value
     14        after 0s was as early as possible. However, it's possible that other animations start with a
     15        negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
     16        is smaller than that delay. This means that if the machine had been booted for less time than
     17        an accelerated animation's delay, the base transform animation wouldn't overlap.
     18
     19        We now ensure that those base transform animations start as early as the earliest animation
     20        that is being committed in a call to GraphicsLayerCA::updateAnimations().
     21
     22        * platform/graphics/ca/GraphicsLayerCA.cpp:
     23        (WebCore::GraphicsLayerCA::updateAnimations):
     24        (WebCore::GraphicsLayerCA::setAnimationOnLayer):
     25        * platform/graphics/ca/GraphicsLayerCA.h:
     26        (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):
     27
    1282020-10-20  Rob Buis  <rbuis@igalia.com>
    229
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r268714 r268746  
    28622862void GraphicsLayerCA::updateAnimations()
    28632863{
     2864    auto baseTransformAnimationBeginTime = 1_s;
     2865    auto currentTime = Seconds(CACurrentMediaTime());
     2866    auto updateBeginTimes = [&](LayerPropertyAnimation& animation)
     2867    {
     2868        if (animation.m_pendingRemoval)
     2869            return;
     2870
     2871        // In case we have an offset, and we haven't set an explicit begin time previously,
     2872        // we need to record the beginTime now.
     2873        if (animation.m_timeOffset && !animation.m_beginTime)
     2874            animation.m_beginTime = currentTime;
     2875
     2876        // Now check if we have a resolved begin time and ensure the begin time we'll use for
     2877        // base transform animations matches the smallest known begin time to guarantee that
     2878        // such animations can combine with other explicit transform animations correctly.
     2879        if (auto computedBeginTime = animation.computedBeginTime())
     2880            baseTransformAnimationBeginTime = std::min(baseTransformAnimationBeginTime, *computedBeginTime);
     2881    };
     2882
    28642883    enum class Additive { Yes, No };
    28652884    auto addAnimation = [&](LayerPropertyAnimation& animation, Additive additive = Additive::Yes) {
     
    28912910        // To ensure the base value transform is applied along with all the interpolating animations, we set it to have started
    28922911        // as early as possible, which combined with the infinite duration ensures it's current for any given CA media time.
    2893         animation.m_beginTime = Seconds::fromNanoseconds(1);
     2912        animation.m_beginTime = baseTransformAnimationBeginTime;
    28942913
    28952914        // Additivity will depend on the source of the matrix, if it was explicitly provided as an identity matrix, it
     
    29012920    };
    29022921
    2903     // Remove all running CA animations.
     2922    // Iterate through all animations to update each animation's begin time, if necessary,
     2923    // compute the base transform animation begin times and remove all running CA animations.
    29042924    for (auto& animation : m_animations) {
     2925        updateBeginTimes(animation);
    29052926        if (animation.m_playState == PlayState::Playing || animation.m_playState == PlayState::Paused)
    29062927            removeCAAnimationFromLayer(animation);
     
    30223043    auto& caAnim = *animation.m_animation;
    30233044
    3024     if (animation.m_timeOffset) {
    3025         // In case we have an offset, we need to record the beginTime now since we have to pass in an explicit
    3026         // value in the first place.
    3027         if (!animation.m_beginTime)
    3028             animation.m_beginTime = Seconds(CACurrentMediaTime());
    3029         caAnim.setBeginTime((animation.m_beginTime - animation.m_timeOffset).seconds());
    3030     } else if (animation.m_beginTime) {
    3031         // If we already have a begin time, then we already started in the past and must ensure we use that same
    3032         // begin time. Any other case will get use the CA transaction's time as its begin time and will be recorded
    3033         // in platformCALayerAnimationStarted().
    3034         caAnim.setBeginTime(animation.m_beginTime.seconds());
    3035     }
     3045    if (auto beginTime = animation.computedBeginTime())
     3046        caAnim.setBeginTime(beginTime->seconds());
    30363047
    30373048    String animationID = animation.animationIdentifier();
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r268615 r268746  
    3131#include "PlatformCALayerClient.h"
    3232#include <wtf/HashMap.h>
     33#include <wtf/Optional.h>
    3334#include <wtf/RetainPtr.h>
    3435#include <wtf/text/StringHash.h>
     
    463464
    464465        String animationIdentifier() const { return makeString(m_name, '_', static_cast<unsigned>(m_property), '_', m_index, '_', m_subIndex); }
     466        Optional<Seconds> computedBeginTime() const
     467        {
     468            if (m_beginTime)
     469                return m_beginTime - m_timeOffset;
     470            return WTF::nullopt;
     471        }
    465472
    466473        RefPtr<PlatformCAAnimation> m_animation;
Note: See TracChangeset for help on using the changeset viewer.