summaryrefslogtreecommitdiff
path: root/chromium/media/gpu
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-06-05 17:27:05 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-06-18 08:33:46 +0000
commit9f4560b1027ae06fdb497023cdcaf91b8511fa74 (patch)
treef9789c1b2941956c5cc104cf03c6b6cc93759152 /chromium/media/gpu
parentd17ea114e5ef69ad5d5d7413280a13e6428098aa (diff)
downloadqtwebengine-chromium-9f4560b1027ae06fdb497023cdcaf91b8511fa74.tar.gz
BASELINE: Update Chromium to 67.0.3396.76
Change-Id: I9a14af4efb092ab203e9364f0779fca781909a38 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/media/gpu')
-rw-r--r--chromium/media/gpu/android/surface_texture_gl_owner.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/chromium/media/gpu/android/surface_texture_gl_owner.cc b/chromium/media/gpu/android/surface_texture_gl_owner.cc
index f4b4d5be5d5..067fe429c71 100644
--- a/chromium/media/gpu/android/surface_texture_gl_owner.cc
+++ b/chromium/media/gpu/android/surface_texture_gl_owner.cc
@@ -73,11 +73,20 @@ SurfaceTextureGLOwnerImpl::~SurfaceTextureGLOwnerImpl() {
// Make sure that the SurfaceTexture isn't using the GL objects.
surface_texture_ = nullptr;
- ui::ScopedMakeCurrent scoped_make_current(context_.get(), surface_.get());
- if (scoped_make_current.Succeeded()) {
- glDeleteTextures(1, &texture_id_);
- DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
+ std::unique_ptr<ui::ScopedMakeCurrent> scoped_make_current;
+
+ // If the context is current, skip ScopedMakeCurrent to prevent (a) a
+ // potentially heavyweight virtual context switch and (b) a potential crash
+ // during stub destruction (https://crbug.com/839605).
+ if (!context_->IsCurrent(nullptr)) {
+ scoped_make_current =
+ std::make_unique<ui::ScopedMakeCurrent>(context_.get(), surface_.get());
+ if (!scoped_make_current->Succeeded())
+ return;
}
+
+ glDeleteTextures(1, &texture_id_);
+ DCHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
}
GLuint SurfaceTextureGLOwnerImpl::GetTextureId() const {