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

Commit c002936e authored by Romain Guy's avatar Romain Guy Committed by Jean-Baptiste Queru
Browse files

Trigger the log when EGL_NO_CONTEXT is returned by eglCreateContext

Bug #7216919

Change-Id: If2059227d55e8ddb2d2673ee36029c3c92dd9a3d
parent bf2e088b
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -864,12 +864,6 @@ 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));
            }
        }
@@ -998,8 +992,15 @@ public abstract class HardwareRenderer {
        EGLContext createContext(EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig) {
            int[] attribs = { EGL_CONTEXT_CLIENT_VERSION, mGlVersion, EGL_NONE };

            return egl.eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT,
            EGLContext context = egl.eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT,
                    mGlVersion != 0 ? attribs : null);
            if (context == null) {
                //noinspection ConstantConditions
                throw new IllegalStateException(
                        "Could not create an EGL context. eglCreateContext failed with error: " +
                        GLUtils.getEGLErrorString(sEgl.eglGetError()));
            }
            return context;
        }

        @Override