Changeset 225310 in webkit


Ignore:
Timestamp:
Nov 29, 2017 5:50:14 PM (6 years ago)
Author:
Simon Fraser
Message:

Missing layer content when animating elements on-screen
https://bugs.webkit.org/show_bug.cgi?id=180178
rdar://problem/34923438

Reviewed by Dean Jackson.

If a delayed animation starts, that animates layers from offscreen, then we would fail
to run the logic that ensures that those layers have backing store.

Fix by ensuring that if any layer starts or ends a transform animation, we re-evaluate
backing store attachment on all its descendants.

I tried to make a test, but layer flushing is timing-sensitive and the test would have taken
5s, and not been reliable. There's a manual test in the bug.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::recursiveCommitChanges):

  • platform/graphics/ca/GraphicsLayerCA.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225308 r225310  
     12017-11-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Missing layer content when animating elements on-screen
     4        https://bugs.webkit.org/show_bug.cgi?id=180178
     5        rdar://problem/34923438
     6
     7        Reviewed by Dean Jackson.
     8
     9        If a delayed animation starts, that animates layers from offscreen, then we would fail
     10        to run the logic that ensures that those layers have backing store.
     11
     12        Fix by ensuring that if any layer starts or ends a transform animation, we re-evaluate
     13        backing store attachment on all its descendants.
     14
     15        I tried to make a test, but layer flushing is timing-sensitive and the test would have taken
     16        5s, and not been reliable. There's a manual test in the bug.
     17
     18        * platform/graphics/ca/GraphicsLayerCA.cpp:
     19        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     20        * platform/graphics/ca/GraphicsLayerCA.h:
     21
    1222017-11-29  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r225220 r225310  
    14631463    setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained);
    14641464
     1465    if (commitState.ancestorStartedOrEndedTransformAnimation)
     1466        addUncommittedChanges(CoverageRectChanged);
     1467
    14651468#ifdef VISIBLE_TILE_WASH
    14661469    // Use having a transform as a key to making the tile wash layer. If every layer gets a wash,
     
    15021505        baseRelativePosition += m_position;
    15031506
     1507    bool wasRunningTransformAnimation = isRunningTransformAnimation();
     1508
    15041509    commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition);
    15051510
    1506     if (isRunningTransformAnimation()) {
     1511    bool nowRunningTransformAnimation = wasRunningTransformAnimation;
     1512    if (m_uncommittedChanges & AnimationChanged)
     1513        nowRunningTransformAnimation = isRunningTransformAnimation();
     1514
     1515    if (wasRunningTransformAnimation != nowRunningTransformAnimation)
     1516        childCommitState.ancestorStartedOrEndedTransformAnimation = true;
     1517
     1518    if (nowRunningTransformAnimation) {
    15071519        childCommitState.ancestorHasTransformAnimation = true;
    15081520        if (m_intersectsCoverageRect)
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r225220 r225310  
    158158        bool ancestorHadChanges { false };
    159159        bool ancestorHasTransformAnimation { false };
     160        bool ancestorStartedOrEndedTransformAnimation { false };
    160161        bool ancestorWithTransformAnimationIntersectsCoverageRect { false };
    161162        bool ancestorIsViewportConstrained { false };
Note: See TracChangeset for help on using the changeset viewer.