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

Commit 740ee65d authored by Romain Guy's avatar Romain Guy
Browse files

Add extra EGL error checking

Change-Id: I7cacef41ed08118c5eecf674e3d8461473692968
parent f9c6a10d
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -733,6 +733,11 @@ public abstract class HardwareRenderer {
         */
        void checkEglErrors() {
            if (isEnabled()) {
                checkEglErrorsForced();
            }
        }

        private void checkEglErrorsForced() {
            int error = sEgl.eglGetError();
            if (error != EGL_SUCCESS) {
                // something bad has happened revert to
@@ -741,7 +746,6 @@ public abstract class HardwareRenderer {
                fallback(error != EGL11.EGL_CONTEXT_LOST);
            }
        }
        }

        private void fallback(boolean fallback) {
            destroy(true);
@@ -813,6 +817,8 @@ public abstract class HardwareRenderer {
                                GLUtils.getEGLErrorString(sEgl.eglGetError()));
                    }

                    checkEglErrorsForced();

                    sEglConfig = chooseEglConfig();
                    if (sEglConfig == null) {
                        // We tried to use EGL_SWAP_BEHAVIOR_PRESERVED_BIT, try again without