Commit b878b5b0 authored by Eric Karl's avatar Eric Karl Committed by Commit Bot

Make context current before destroying SharedImage

This feels like an oversight in the GPU-side callback path. The normal
IPC path always makes current (and some backing seem to rely on this).

Change-Id: I4b8b765f5b8c5c2243dc21609ff139a7347a27c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793747
Commit-Queue: vikas soni <vikassoni@chromium.org>
Reviewed-by: default avatarvikas soni <vikassoni@chromium.org>
Auto-Submit: Eric Karl <ericrk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695656}
parent f8ead841
......@@ -491,19 +491,15 @@ void SharedImageStub::DestroySharedImage(const Mailbox& mailbox,
const SyncToken& sync_token) {
// If there is no sync token, we don't need to wait.
if (!sync_token.HasData()) {
OnSyncTokenReleased(mailbox);
OnDestroySharedImage(mailbox);
return;
}
auto done_cb = base::BindOnce(&SharedImageStub::OnSyncTokenReleased,
auto done_cb = base::BindOnce(&SharedImageStub::OnDestroySharedImage,
weak_factory_.GetWeakPtr(), mailbox);
channel_->scheduler()->ScheduleTask(
gpu::Scheduler::Task(sequence_, std::move(done_cb),
std::vector<gpu::SyncToken>({sync_token})));
}
void SharedImageStub::OnSyncTokenReleased(const Mailbox& mailbox) {
factory_->DestroySharedImage(mailbox);
}
} // namespace gpu
......@@ -93,7 +93,6 @@ class GPU_IPC_SERVICE_EXPORT SharedImageStub
bool MakeContextCurrent();
ContextResult MakeContextCurrentAndCreateFactory();
void OnError();
void OnSyncTokenReleased(const Mailbox& mailbox);
// Wait on the sync token if any and destroy the shared image.
void DestroySharedImage(const Mailbox& mailbox, const SyncToken& sync_token);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment