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

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

Merge "Add extra error check when eglCreateContext fails Bug #7216919" into jb-mr1-dev

parents 71779b9f 4c7dc4aa
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -864,6 +864,12 @@ public abstract class HardwareRenderer {


            if (mEglContext == null) {
            if (mEglContext == null) {
                mEglContext = createContext(sEgl, sEglDisplay, sEglConfig);
                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));
                sEglContextStorage.set(createManagedContext(mEglContext));
            }
            }
        }
        }