From c1ea187aa6785a8aa5ffae516c7c0e7ccbff7a87 Mon Sep 17 00:00:00 2001 From: sotaro Date: Wed, 6 Jan 2021 12:12:42 +0000 Subject: [PATCH] Bug 1685253 - Fix error handling of RenderCompositorEGL::Resume() r=nical Changed as to return false when resume fails. Differential Revision: https://phabricator.services.mozilla.com/D100872 --- gfx/webrender_bindings/RenderCompositorEGL.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp b/gfx/webrender_bindings/RenderCompositorEGL.cpp index 2d5e37825688..991a348d3be6 100644 --- a/gfx/webrender_bindings/RenderCompositorEGL.cpp +++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp @@ -146,6 +146,10 @@ bool RenderCompositorEGL::Resume() { // Destroy EGLSurface if it exists. DestroyEGLSurface(); mEGLSurface = CreateEGLSurface(); + if (mEGLSurface == EGL_NO_SURFACE) { + RenderThread::Get()->HandleWebRenderError(WebRenderError::NEW_SURFACE); + return false; + } gl::GLContextEGL::Cast(gl())->SetEGLSurfaceOverride(mEGLSurface); #ifdef MOZ_WIDGET_ANDROID @@ -179,6 +183,7 @@ bool RenderCompositorEGL::Resume() { egl->fSwapInterval(0); } else { RenderThread::Get()->HandleWebRenderError(WebRenderError::NEW_SURFACE); + return false; } } return true;