Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0c3e3e18a165f40ad1f941562148997465f8baab
https://github.com/WebKit/WebKit/commit/0c3e3e18a165f40ad1f941562148997465f8baab
Author: Matt Woodrow <[email protected]>
Date: 2024-11-13 (Wed, 13 Nov 2024)
Changed paths:
M Source/WebCore/dom/ViewTransition.cpp
M Source/WebCore/dom/ViewTransition.h
M Source/WebCore/rendering/RenderLayerBacking.cpp
Log Message:
-----------
View transition old snapshots don't get flushed until we try to use them
https://bugs.webkit.org/show_bug.cgi?id=282676
<rdar://139339149>
Reviewed by Simon Fraser.
View transition old snapshots get recorded during the 'activate' phase which
happens outside of a rendering update.
We have a tradeoff between flushing them immediately so that the work completes
before the rendering update, and flushing more than is needed and having some of
it block the rendering update's work.
This adds a check if the element being captured in the 'old' state intersects
the viewport, and flushes the snapshot if so (after all the snapshot buffers
have been allocated, to prevent rendering work from blocking backend handles
being returned). This isn't strictly what will be used in the first frame of the
animation, since authors can style and locate the pseudos arbitrarily, but it
should be close enough usually.
GraphicsLayerCARemote::setLayerContentsToImageBuffer already flushes buffers as
they get set, so if we ever use a snapshot that wasn't included in the initial
flush then it gets flushed at that point.
It also changes the 'isDirectlyCompositedImage' path to return false for
elements that are known to be offscreen (inside a position:fixed and we computed
that the backing store can be detached). Without this, we just forward the
ImageBuffer to the relevant GraphicsLayer for every single psuedo, which
triggers the 'flush on use' path for everything.
* Source/WebCore/dom/ViewTransition.cpp:
(WebCore::ViewTransition::captureOldState):
(WebCore::ViewTransition::updatePropertiesForRenderer):
(WebCore::ViewTransition::copyElementBaseProperties):
* Source/WebCore/dom/ViewTransition.h:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAllowsBackingStoreDetaching):
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
* Source/WebCore/rendering/RenderViewTransitionCapture.cpp:
(WebCore::RenderViewTransitionCapture::image):
* Source/WebCore/rendering/RenderViewTransitionCapture.h:
Canonical link: https://commits.webkit.org/286553@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes