Changeset 215750 in webkit


Ignore:
Timestamp:
Apr 25, 2017 12:20:17 PM (7 years ago)
Author:
Antti Koivisto
Message:

REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=171060
<rdar://problem/31771174>

Reviewed by Simon Fraser.

Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
To update tile coverage we need to commit such subtrees even if there are not other changes.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::needsCommit):

Commit subtrees with accelerated transform animations.
Factor into a function.

(WebCore::GraphicsLayerCA::recursiveCommitChanges):

Track if descendants had any accelerated transform animations after commit.

  • platform/graphics/ca/GraphicsLayerCA.h:

(WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
(WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r215746 r215750  
     12017-04-25  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
     4        https://bugs.webkit.org/show_bug.cgi?id=171060
     5        <rdar://problem/31771174>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
     10        To update tile coverage we need to commit such subtrees even if there are not other changes.
     11
     12        * platform/graphics/ca/GraphicsLayerCA.cpp:
     13        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
     14        (WebCore::GraphicsLayerCA::needsCommit):
     15
     16            Commit subtrees with accelerated transform animations.
     17            Factor into a function.
     18
     19        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     20
     21            Track if descendants had any accelerated transform animations after commit.
     22
     23        * platform/graphics/ca/GraphicsLayerCA.h:
     24        (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
     25        (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):
     26
    1272017-04-25  Eric Carlson  <eric.carlson@apple.com>
    228
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r215469 r215750  
    391391GraphicsLayerCA::GraphicsLayerCA(Type layerType, GraphicsLayerClient& client)
    392392    : GraphicsLayer(layerType, client)
    393     , m_needsFullRepaint(false)
    394     , m_usingBackdropLayerType(false)
    395     , m_isViewportConstrained(false)
    396     , m_intersectsCoverageRect(false)
    397     , m_hasEverPainted(false)
    398393{
    399394}
     
    14111406}
    14121407
     1408bool GraphicsLayerCA::needsCommit(const CommitState& commitState)
     1409{
     1410    if (commitState.ancestorHadChanges)
     1411        return true;
     1412    if (m_uncommittedChanges)
     1413        return true;
     1414    if (hasDescendantsWithUncommittedChanges())
     1415        return true;
     1416    // Accelerated transforms move the underlying layers without GraphicsLayers getting invalidated.
     1417    if (isRunningTransformAnimation())
     1418        return true;
     1419    if (hasDescendantsWithRunningTransformAnimations())
     1420        return true;
     1421
     1422    return false;
     1423}
     1424
    14131425// rootRelativeTransformForScaling is a transform from the root, but for layers with transform animations, it cherry-picked the state of the
    14141426// animation that contributes maximally to the scale (on every layer with animations down the hierarchy).
    14151427void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
    14161428{
    1417     if (!commitState.ancestorHadChanges && !m_uncommittedChanges && !hasDescendantsWithUncommittedChanges())
     1429    if (!needsCommit(commitState))
    14181430        return;
    14191431
     
    14881500    const Vector<GraphicsLayer*>& childLayers = children();
    14891501    size_t numChildren = childLayers.size();
     1502
     1503    bool hasDescendantsWithRunningTransformAnimations = false;
    14901504   
    14911505    for (size_t i = 0; i < numChildren; ++i) {
    14921506        GraphicsLayerCA& currentChild = downcast<GraphicsLayerCA>(*childLayers[i]);
    14931507        currentChild.recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     1508
     1509        if (currentChild.isRunningTransformAnimation() || currentChild.hasDescendantsWithRunningTransformAnimations())
     1510            hasDescendantsWithRunningTransformAnimations = true;
    14941511    }
    14951512
     
    15011518
    15021519    setHasDescendantsWithUncommittedChanges(false);
     1520    setHasDescendantsWithRunningTransformAnimations(hasDescendantsWithRunningTransformAnimations);
    15031521
    15041522    bool hadDirtyRects = m_uncommittedChanges & DirtyRectsChanged;
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r215469 r215750  
    160160        bool ancestorIsViewportConstrained { false };
    161161    };
     162    bool needsCommit(const CommitState&);
    162163    void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
    163164
     
    510511    void noteChangesForScaleSensitiveProperties();
    511512
     513    bool hasDescendantsWithRunningTransformAnimations() const { return m_hasDescendantsWithRunningTransformAnimations; }
     514    void setHasDescendantsWithRunningTransformAnimations(bool b) { m_hasDescendantsWithRunningTransformAnimations = b; }
     515
    512516    void propagateLayerChangeToReplicas(ScheduleFlushOrNot = ScheduleFlush);
    513517
     
    542546   
    543547    ContentsLayerPurpose m_contentsLayerPurpose { NoContentsLayer };
    544     bool m_needsFullRepaint : 1;
    545     bool m_usingBackdropLayerType : 1;
    546     bool m_isViewportConstrained : 1;
    547     bool m_intersectsCoverageRect : 1;
    548     bool m_hasEverPainted : 1;
     548    bool m_needsFullRepaint { false };
     549    bool m_usingBackdropLayerType { false };
     550    bool m_isViewportConstrained { false };
     551    bool m_intersectsCoverageRect { false };
     552    bool m_hasEverPainted { false };
     553    bool m_hasDescendantsWithRunningTransformAnimations { false };
    549554
    550555    Color m_contentsSolidColor;
Note: See TracChangeset for help on using the changeset viewer.