Bug 1560736 - MakeCurrent after GeckoSurfaceTexture::DestroyUnused. r=snorp
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 03 Jul 2019 14:15:17 +0000
changeset 543994 7cfd4060d3f5726d3abd3be50d1a958eb94bb69a
parent 543993 0efd635f7e152fb053c42b9c0cc5a18894ca4513
child 543995 120801b7d0e13a0b1c023e74dd3f619b98360d25
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1560736
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1560736 - MakeCurrent after GeckoSurfaceTexture::DestroyUnused. r=snorp Seems like GeckoSurfaceTexture::DestroyUnused can change the current context. Differential Revision: https://phabricator.services.mozilla.com/D36685
gfx/layers/opengl/CompositorOGL.cpp
gfx/webrender_bindings/RenderCompositorEGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -781,16 +781,17 @@ void CompositorOGL::BeginFrame(const nsI
     MakeCurrent();
   }
 
   mPixelsPerFrame = width * height;
   mPixelsFilled = 0;
 
 #ifdef MOZ_WIDGET_ANDROID
   java::GeckoSurfaceTexture::DestroyUnused((int64_t)mGLContext.get());
+  mGLContext->MakeCurrent();  // DestroyUnused can change the current context!
 #endif
 
   // Default blend function implements "OVER"
   mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
                                  LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA);
   mGLContext->fEnable(LOCAL_GL_BLEND);
 
   RefPtr<CompositingRenderTargetOGL> rt =
--- a/gfx/webrender_bindings/RenderCompositorEGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp
@@ -89,16 +89,17 @@ bool RenderCompositorEGL::BeginFrame() {
     const auto& egl = gle->mEgl;
     // Make eglSwapBuffers() non-blocking on wayland.
     egl->fSwapInterval(egl->Display(), 0);
   }
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
   java::GeckoSurfaceTexture::DestroyUnused((int64_t)gl());
+  gl()->MakeCurrent();  // DestroyUnused can change the current context!
 #endif
 
   return true;
 }
 
 void RenderCompositorEGL::EndFrame() {
   if (mEGLSurface != EGL_NO_SURFACE) {
     gl()->SwapBuffers();