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

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

Merge "Add extra EGL error checking" into jb-mr1-dev

parents 2bb25cd5 740ee65d
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