Do not abort EGL backend creation if EGL_NV_post_sub_buffer isn't supported

In case the extension is not present eglQuerySurface returns EGL_FALSE
when querying for EGL_POST_SUB_BUFFER_SUPPORTED_NV and sets an
EGL_BAD_ATTRIBUTE error state. If this is the case it's not an error we
should abort on, but one we should ignore as it's the same as extension
not supported.

BUG: 315114
FIXED: 4.10.1
This commit is contained in:
Martin Gräßlin 2013-02-20 08:03:02 +01:00
parent 7255352e62
commit b8dcc04373

View file

@ -118,8 +118,13 @@ bool EglOnXBackend::initRenderingContext()
eglSurfaceAttrib(dpy, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); eglSurfaceAttrib(dpy, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
if (eglQuerySurface(dpy, surface, EGL_POST_SUB_BUFFER_SUPPORTED_NV, &surfaceHasSubPost) == EGL_FALSE) { if (eglQuerySurface(dpy, surface, EGL_POST_SUB_BUFFER_SUPPORTED_NV, &surfaceHasSubPost) == EGL_FALSE) {
kError(1212) << "query surface failed"; EGLint error = eglGetError();
return false; if (error != EGL_SUCCESS && error != EGL_BAD_ATTRIBUTE) {
kError(1212) << "query surface failed";
return false;
} else {
surfaceHasSubPost = EGL_FALSE;
}
} }
const EGLint context_attribs[] = { const EGLint context_attribs[] = {