Skip to content

Commit

Permalink
Apply patch. rdar://problem/100252324
Browse files Browse the repository at this point in the history
  • Loading branch information
alancoon committed Dec 22, 2022
1 parent 078f717 commit 7c4a28f
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7c4a28f

Please sign in to comment.