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 506716 4b5ae6076e03ae92c5be593491bedea65ca5336c
parent 506715 8d48fc5df52513e5d144f1334bad6f188c333916
child 506717 44fe44a6a340b557bda4467ec632db5f4ac47c02
push id10526
push userryanvm@gmail.com
push dateTue, 15 Jan 2019 21:05:27 +0000
treeherdermozilla-beta@92b23e3b94ef [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() {}