Skip to content

Commit

Permalink
Unaccelerated rendering with GPUP shows stale content.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=255112
<rdar://107717934>

Reviewed by Simon Fraser.

Only IOSurface/MachSendRight types can be cached using CAIOSurface, otherwise
we end up caching a stale CGImage copied from a ShareableBitmapHandle.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStoreProperties::updateCachedBuffers):

Canonical link: https://commits.webkit.org/262686@main
  • Loading branch information
mattwoodrow committed Apr 6, 2023
1 parent b8c7f56 commit c5cd2f9
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -693,7 +693,7 @@ static bool hasValue(const ImageBufferBackendHandle& backendHandle)
{
Vector<RemoteLayerTreeNode::CachedContentsBuffer> cachedBuffers = node.takeCachedContentsBuffers();

if (contentsType != LayerContentsType::CachedIOSurface || !m_frontBufferIdentifier)
if (contentsType != LayerContentsType::CachedIOSurface || !m_frontBufferIdentifier || !m_bufferHandle || !std::holds_alternative<MachSendRight>(*m_bufferHandle))
return;

cachedBuffers.removeAllMatching([&](const RemoteLayerTreeNode::CachedContentsBuffer& current) {
Expand Down

0 comments on commit c5cd2f9

Please sign in to comment.