Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3facf34 authored by Romain Guy's avatar Romain Guy
Browse files

Don't recreate the EGL surface if the surface is not ready

Bug #5114545

Change-Id: I95149dc18e0582ca358716a6b0d89a4edc8fca26
parent 85de77a1
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -713,7 +713,12 @@ public abstract class HardwareRenderer {
            // Cancels any existing buffer to ensure we'll get a buffer
            // of the right size before we call eglSwapBuffers
            sEgl.eglMakeCurrent(sEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
            
            if (mEglSurface != null && mEglSurface != EGL_NO_SURFACE) {
                sEgl.eglDestroySurface(sEglDisplay, mEglSurface);
            }

            if (holder.getSurface().isValid()) {
                mEglSurface = sEgl.eglCreateWindowSurface(sEglDisplay, sEglConfig, holder, null);
    
                if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) {
@@ -726,6 +731,7 @@ public abstract class HardwareRenderer {
                            + getEGLErrorString(error));
                }
            }
        }

        @Override
        boolean validate() {