Title: [225310] trunk/Source/WebCore
Revision
225310
Author
simon.fra...@apple.com
Date
2017-11-29 17:50:14 -0800 (Wed, 29 Nov 2017)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (225309 => 225310)


--- trunk/Source/WebCore/ChangeLog	2017-11-30 01:40:56 UTC (rev 225309)
+++ trunk/Source/WebCore/ChangeLog	2017-11-30 01:50:14 UTC (rev 225310)
@@ -1,3 +1,24 @@
+2017-11-29  Simon Fraser  <simon.fra...@apple.com>
+
+        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:
+
 2017-11-29  Youenn Fablet  <you...@apple.com>
 
         ServiceWorkerClient objects should be reused if there is already one existing with the same identifier

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (225309 => 225310)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2017-11-30 01:40:56 UTC (rev 225309)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2017-11-30 01:50:14 UTC (rev 225310)
@@ -1462,6 +1462,9 @@
     }
     setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained);
 
+    if (commitState.ancestorStartedOrEndedTransformAnimation)
+        addUncommittedChanges(CoverageRectChanged);
+
 #ifdef VISIBLE_TILE_WASH
     // Use having a transform as a key to making the tile wash layer. If every layer gets a wash,
     // they start to obscure useful information.
@@ -1501,9 +1504,18 @@
     if (affectedByPageScale)
         baseRelativePosition += m_position;
 
+    bool wasRunningTransformAnimation = isRunningTransformAnimation();
+
     commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition);
 
-    if (isRunningTransformAnimation()) {
+    bool nowRunningTransformAnimation = wasRunningTransformAnimation;
+    if (m_uncommittedChanges & AnimationChanged)
+        nowRunningTransformAnimation = isRunningTransformAnimation();
+
+    if (wasRunningTransformAnimation != nowRunningTransformAnimation)
+        childCommitState.ancestorStartedOrEndedTransformAnimation = true;
+
+    if (nowRunningTransformAnimation) {
         childCommitState.ancestorHasTransformAnimation = true;
         if (m_intersectsCoverageRect)
             childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect = true;

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (225309 => 225310)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2017-11-30 01:40:56 UTC (rev 225309)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2017-11-30 01:50:14 UTC (rev 225310)
@@ -157,6 +157,7 @@
         int treeDepth { 0 };
         bool ancestorHadChanges { false };
         bool ancestorHasTransformAnimation { false };
+        bool ancestorStartedOrEndedTransformAnimation { false };
         bool ancestorWithTransformAnimationIntersectsCoverageRect { false };
         bool ancestorIsViewportConstrained { false };
     };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to