Commit cf21788e authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Do not create a temp offscreen surface during shutdown

Bug: 824382
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: If3d967a2b90f8910fd696ddd8bddc741d4f9ecc5
Reviewed-on: https://chromium-review.googlesource.com/1110020Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570127}
parent 1d8b06e4
...@@ -165,13 +165,16 @@ GpuServiceImpl::~GpuServiceImpl() { ...@@ -165,13 +165,16 @@ GpuServiceImpl::~GpuServiceImpl() {
scheduler_->DestroySequence(skia_output_surface_sequence_id_); scheduler_->DestroySequence(skia_output_surface_sequence_id_);
} }
if (context_for_skia_) { if (context_for_skia_ && !context_for_skia_->IsCurrent(nullptr)) {
// Initialize an offscreen surface, so MakeCurrent can work. if (!context_for_skia_->MakeCurrent(
auto surface = gl::init::CreateOffscreenGLSurface(gfx::Size(1, 1)); gpu_channel_manager_->GetDefaultOffscreenSurface())) {
context_for_skia_->MakeCurrent(surface.get()); LOG(ERROR) << "Failed to make current.";
gr_context_ = nullptr; gr_context_->abandonContext();
context_for_skia_ = nullptr; }
} }
gr_context_ = nullptr;
context_for_skia_ = nullptr;
DCHECK(!gr_context_); DCHECK(!gr_context_);
media_gpu_channel_manager_.reset(); media_gpu_channel_manager_.reset();
gpu_channel_manager_.reset(); gpu_channel_manager_.reset();
......
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