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

Commit 590840ff authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Don't recreate the EGL surface if the surface is not ready Bug #5114545"

parents cb484804 d3facf34
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() {