Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Tiled layer flicker when an animation ends
https://bugs.webkit.org/show_bug.cgi?id=244017 <rdar://89111231> Reviewed by Tim Horton. The test page (internal to Apple) had a tiled layer whose transform was animated via a transition. When the animation finished, there was sometimes a frame where tiles were missing, causing a visual flash. When tiled layers are being animated, we wake up every frame to re-evaluate the tile coverage. Transform animations are implemented via Core Animation; the code makes a fill-forwards animation on the layer. For such animations, `DocumentTimeline::timeToNextTick()` ensures that we don't waste power doing rendering updates on every frame, scheduling a timer to fire for the next relevant time. However, it was possible for this timer to fire late; this resulted in a frame where the tile coverage logic, which consults DocumentTimeline animation state, saw an animation that had completed (and computed tile coverage on that basis), but the CAAnimation was still affecting the rendered result, putting the tiled layer in a position where some areas without tile coverage were exposed. Fix by having the m_tickScheduleTimer fire slightly (~16ms) earlier, so that DocumentTimeline animations have their correct state when consulted for tile coverage computation. This may result in a few more rendering updates at the ends of accelerated animations (as detected by layout tests), but that should be benign. * LayoutTests/animations/no-style-recalc-during-accelerated-animation.html: * LayoutTests/animations/steps-transform-rendering-updates-expected.txt: * LayoutTests/animations/steps-transform-rendering-updates.html: * Source/WebCore/animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::scheduleAnimationResolution): (WebCore::DocumentTimeline::scheduleNextTick): Canonical link: https://commits.webkit.org/253549@main
- Loading branch information