From 7c4a28f260ea758348a666f78098308b412c8a35 Mon Sep 17 00:00:00 2001 From: Alan Coon Date: Wed, 21 Dec 2022 13:56:37 -0800 Subject: [PATCH] Apply patch. rdar://problem/100252324 Fix build on branch after 5192197861cf. Canonical link: https://commits.webkit.org/252432.1011@safari-7614.4.6.0-branch --- .../GPU/graphics/RemoteGraphicsContextGLProxy.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp index ea45ac184909..a613ef01dad8 100644 --- a/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp +++ b/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp @@ -317,17 +317,18 @@ void RemoteGraphicsContextGLProxy::readnPixelsSharedMemory(GCGLint x, GCGLint y, markContextLost(); return; } - auto handle = buffer->createHandle(SharedMemory::Protection::ReadWrite); - if (!handle || handle->isNull()) { + SharedMemory::Handle handle; + buffer->createHandle(handle, SharedMemory::Protection::ReadWrite); + if (handle.isNull()) { markContextLost(); return; } - memcpy(buffer->data(), data.data(), data.size()); - auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::ReadnPixels2(x, y, width, height, format, type, WTFMove(*handle))); + memcpy(buffer->data(), data.data, data.bufSize); + bool success = false; + auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::ReadnPixels2(x, y, width, height, format, type, WTFMove(handle)), Messages::RemoteGraphicsContextGL::ReadnPixels2::Reply(success)); if (sendResult) { - auto [success] = sendResult.takeReply(); if (success) - memcpy(data.data(), buffer->data(), data.size()); + memcpy(data.data, buffer->data(), data.bufSize); } else markContextLost(); }