Bug 1493497 - Clear EGLSurfaceOverride correctly in SharedSurface_ANGLEShareHandle. r=jgilbert, a=RyanVM
authorsotaro <sotaro.ikeda.g@gmail.com>
Thu, 27 Dec 2018 17:00:59 +0900
changeset 509488 4b5ae6076e03ae92c5be593491bedea65ca5336c
parent 509487 8d48fc5df52513e5d144f1334bad6f188c333916
child 509489 44fe44a6a340b557bda4467ec632db5f4ac47c02
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, RyanVM
bugs1493497
milestone65.0
Bug 1493497 - Clear EGLSurfaceOverride correctly in SharedSurface_ANGLEShareHandle. r=jgilbert, a=RyanVM
gfx/gl/SharedSurfaceANGLE.cpp
--- a/gfx/gl/SharedSurfaceANGLE.cpp
+++ b/gfx/gl/SharedSurfaceANGLE.cpp
@@ -93,16 +93,19 @@ SharedSurface_ANGLEShareHandle::SharedSu
     : SharedSurface(SharedSurfaceType::EGLSurfaceANGLE, AttachmentType::Screen,
                     gl, size, hasAlpha, true),
       mEGL(egl),
       mPBuffer(pbuffer),
       mShareHandle(shareHandle),
       mKeyedMutex(keyedMutex) {}
 
 SharedSurface_ANGLEShareHandle::~SharedSurface_ANGLEShareHandle() {
+  if (GLContextEGL::Cast(mGL)->GetEGLSurfaceOverride() == mPBuffer) {
+    GLContextEGL::Cast(mGL)->SetEGLSurfaceOverride(EGL_NO_SURFACE);
+  }
   mEGL->fDestroySurface(Display(), mPBuffer);
 }
 
 void SharedSurface_ANGLEShareHandle::LockProdImpl() {
   GLContextEGL::Cast(mGL)->SetEGLSurfaceOverride(mPBuffer);
 }
 
 void SharedSurface_ANGLEShareHandle::UnlockProdImpl() {}