Commit 2826f028 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

ExternalVKImageBacking: make current before delete texture passthrough

Bug: 1020626
Change-Id: I70860caa686d221c3346eaaa018f9304c04a6f5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1955864
Commit-Queue: Peng Huang <penghuang@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Auto-Submit: Peng Huang <penghuang@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722575}
parent 7d536893
...@@ -516,7 +516,12 @@ void ExternalVkImageBacking::Destroy() { ...@@ -516,7 +516,12 @@ void ExternalVkImageBacking::Destroy() {
context_state()->MakeCurrent(nullptr, true /* need_gl */); context_state()->MakeCurrent(nullptr, true /* need_gl */);
texture_->RemoveLightweightRef(have_context()); texture_->RemoveLightweightRef(have_context());
} }
if (texture_passthrough_) { if (texture_passthrough_) {
// Ensure that a context is current before releasing |texture_passthrough_|,
// it calls glDeleteTextures.
if (!gl::GLContext::GetCurrent())
context_state()->MakeCurrent(nullptr, true /* need_gl */);
if (!have_context()) if (!have_context())
texture_passthrough_->MarkContextLost(); texture_passthrough_->MarkContextLost();
texture_passthrough_ = nullptr; texture_passthrough_ = nullptr;
......
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