Skip to content
Permalink
Browse files
[GPU Process] Unique RenderingResourceIdentifiers Part 3: Uniquify in…
… wakeUpAndApplyDisplayList

https://bugs.webkit.org/show_bug.cgi?id=231405
<rdar://problem/84008003>

Reviewed by Chris Dumez.

This simply applies the same treatment in https://commits.webkit.org/242676@main to
RemoteRenderingBackend::wakeUpAndApplyDisplayList(). This is being done in a follow-up
patch because it relies on https://bugs.webkit.org/show_bug.cgi?id=231403.

No new tests because there is no behavior change.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList):
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayListWithQualifiedIdentifier):
(WebKit::RemoteRenderingBackend::resumeFromPendingWakeupInformation):
* GPUProcess/graphics/RemoteRenderingBackend.h:
(WebKit::RemoteRenderingBackend::PendingWakeupInformation::arguments const): Deleted.


Canonical link: https://commits.webkit.org/242700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
litherum committed Oct 8, 2021
1 parent 5705df7 commit 41c61578cd9cc862c70a37d76ac6708840968420
Showing 3 changed files with 38 additions and 11 deletions.
@@ -1,3 +1,24 @@
2021-10-08 Myles C. Maxfield <mmaxfield@apple.com>

[GPU Process] Unique RenderingResourceIdentifiers Part 3: Uniquify in wakeUpAndApplyDisplayList
https://bugs.webkit.org/show_bug.cgi?id=231405
<rdar://problem/84008003>

Reviewed by Chris Dumez.

This simply applies the same treatment in https://commits.webkit.org/242676@main to
RemoteRenderingBackend::wakeUpAndApplyDisplayList(). This is being done in a follow-up
patch because it relies on https://bugs.webkit.org/show_bug.cgi?id=231403.

No new tests because there is no behavior change.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayList):
(WebKit::RemoteRenderingBackend::wakeUpAndApplyDisplayListWithQualifiedIdentifier):
(WebKit::RemoteRenderingBackend::resumeFromPendingWakeupInformation):
* GPUProcess/graphics/RemoteRenderingBackend.h:
(WebKit::RemoteRenderingBackend::PendingWakeupInformation::arguments const): Deleted.

2021-10-08 Philippe Normand <pnormand@igalia.com>

[WPE][Qt] API export fixes
@@ -336,21 +336,28 @@ RefPtr<ImageBuffer> RemoteRenderingBackend::nextDestinationImageBufferAfterApply
}

void RemoteRenderingBackend::wakeUpAndApplyDisplayList(const GPUProcessWakeupMessageArguments& arguments)
{
// Immediately turn the RenderingResourceIdentifier (which is error-prone) to a QualifiedRenderingResourceIdentifier,
// and use a helper function to make sure that don't accidentally use the RenderingResourceIdentifier (because the helper function can't see it).
wakeUpAndApplyDisplayListWithQualifiedIdentifier(arguments.itemBufferIdentifier, arguments.offset, { arguments.destinationImageBufferIdentifier, m_gpuConnectionToWebProcess->webProcessIdentifier() }, arguments.reason);
}

void RemoteRenderingBackend::wakeUpAndApplyDisplayListWithQualifiedIdentifier(WebCore::DisplayList::ItemBufferIdentifier itemBufferIdentifier, uint64_t offset, QualifiedRenderingResourceIdentifier destinationImageBufferIdentifier, GPUProcessWakeupReason reason)
{
ASSERT(!RunLoop::isMain());

TraceScope tracingScope(WakeUpAndApplyDisplayListStart, WakeUpAndApplyDisplayListEnd);

updateLastKnownState(RemoteRenderingBackendState::BeganReplayingDisplayList);

RefPtr destinationImageBuffer = m_remoteResourceCache.cachedImageBuffer(arguments.destinationImageBufferIdentifier);
RefPtr destinationImageBuffer = m_remoteResourceCache.cachedImageBuffer(destinationImageBufferIdentifier.object());
MESSAGE_CHECK(destinationImageBuffer, "Missing destination image buffer");

auto initialHandle = m_sharedDisplayListHandles.get(arguments.itemBufferIdentifier);
auto initialHandle = m_sharedDisplayListHandles.get(itemBufferIdentifier);
MESSAGE_CHECK(initialHandle, "Missing initial shared display list handle");

LOG_WITH_STREAM(SharedDisplayLists, stream << "Waking up to Items[" << arguments.itemBufferIdentifier << "] => Image(" << arguments.destinationImageBufferIdentifier << ") at " << arguments.offset);
destinationImageBuffer = nextDestinationImageBufferAfterApplyingDisplayLists(*destinationImageBuffer, arguments.offset, *initialHandle, arguments.reason);
LOG_WITH_STREAM(SharedDisplayLists, stream << "Waking up to Items[" << itemBufferIdentifier << "] => Image(" << destinationImageBufferIdentifier.object() << ") at " << offset);
destinationImageBuffer = nextDestinationImageBufferAfterApplyingDisplayLists(*destinationImageBuffer, offset, *initialHandle, reason);

// FIXME: All the callers pass m_pendingWakeupInfo's fields so the body of this function should just be this loop.
while (destinationImageBuffer && m_pendingWakeupInfo) {
@@ -617,9 +624,12 @@ void RemoteRenderingBackend::didCreateSharedDisplayListHandleWithQualifiedIdenti

void RemoteRenderingBackend::resumeFromPendingWakeupInformation()
{
auto arguments = m_pendingWakeupInfo->arguments();
auto itemBufferIdentifier = m_pendingWakeupInfo->itemBufferIdentifier;
auto offset = m_pendingWakeupInfo->offset;
QualifiedRenderingResourceIdentifier destinationImageBufferIdentifier { m_pendingWakeupInfo->destinationImageBufferIdentifier, m_gpuConnectionToWebProcess->webProcessIdentifier() };
auto reason = m_pendingWakeupInfo->reason;
m_pendingWakeupInfo = std::nullopt;
wakeUpAndApplyDisplayList(arguments);
wakeUpAndApplyDisplayListWithQualifiedIdentifier(itemBufferIdentifier, offset, destinationImageBufferIdentifier, reason);
}

void RemoteRenderingBackend::didCreateMaskImageBuffer(ImageBuffer& imageBuffer)
@@ -151,6 +151,7 @@ class RemoteRenderingBackend
void didCreateSharedDisplayListHandle(WebCore::DisplayList::ItemBufferIdentifier, const SharedMemory::IPCHandle&, WebCore::RenderingResourceIdentifier destinationBufferIdentifier);

// Received messages translated to use QualifiedRenderingResourceIdentifier.
void wakeUpAndApplyDisplayListWithQualifiedIdentifier(WebCore::DisplayList::ItemBufferIdentifier, uint64_t offset, QualifiedRenderingResourceIdentifier, GPUProcessWakeupReason);
void createImageBufferWithQualifiedIdentifier(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat, QualifiedRenderingResourceIdentifier);
void getDataURLForImageBufferWithQualifiedIdentifier(const String& mimeType, std::optional<double> quality, WebCore::PreserveResolution, QualifiedRenderingResourceIdentifier, CompletionHandler<void(String&&)>&&);
void getDataForImageBufferWithQualifiedIdentifier(const String& mimeType, std::optional<double> quality, QualifiedRenderingResourceIdentifier, CompletionHandler<void(Vector<uint8_t>&&)>&&);
@@ -184,11 +185,6 @@ class RemoteRenderingBackend
std::optional<WebCore::RenderingResourceIdentifier> missingCachedResourceIdentifier;
RemoteRenderingBackendState state { RemoteRenderingBackendState::Initialized };

GPUProcessWakeupMessageArguments arguments() const
{
return { itemBufferIdentifier, offset, destinationImageBufferIdentifier, reason };
}

bool shouldPerformWakeup(WebCore::RenderingResourceIdentifier identifier) const
{
return destinationImageBufferIdentifier == identifier

0 comments on commit 41c6157

Please sign in to comment.