Commit a68d774e authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

MakeCurrent when creating WrappedSkImage

Skia may change a bunch of GL state (including active texture unit) when
we create a backend texture. We can't easily restore that state, so do
a full (often virtual) context switch instead. This will avoid damaging
another client's state.

Bug: 1095679
Change-Id: I511115f8add6c290fc6a63355cfc4b22a7b1b0c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2476899
Commit-Queue: Jonathan Backer <backer@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Auto-Submit: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817708}
parent e672028c
......@@ -190,7 +190,9 @@ class WrappedSkImage : public ClearTrackingSharedImageBacking {
if (context_state_->context_lost())
return false;
DCHECK(context_state_->IsCurrent(nullptr));
// MakeCurrent to avoid destroying another client's state because Skia may
// change GL state to create and upload textures (crbug.com/1095679).
context_state_->MakeCurrent(nullptr);
context_state_->set_need_context_state_reset(true);
#if BUILDFLAG(ENABLE_VULKAN)
......
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