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

Commit fe03e976 authored by Romain Guy's avatar Romain Guy Committed by The Android Automerger
Browse files

Add extra error check when eglCreateContext fails

Bug #7216919

Change-Id: I322cbe4579d7a4eb2a64d288175e145d0badc857
parent ee4262e0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -864,6 +864,12 @@ public abstract class HardwareRenderer {

            if (mEglContext == null) {
                mEglContext = createContext(sEgl, sEglDisplay, sEglConfig);
                if (mEglContext == null) {
                    //noinspection ConstantConditions
                    throw new IllegalStateException("Could not create an EGL context. " +
                            "eglCreateContext failed with error: " +
                            GLUtils.getEGLErrorString(sEgl.eglGetError()));
                }
                sEglContextStorage.set(createManagedContext(mEglContext));
            }
        }