[platforms/x11] Add more warning on failure to create EGL context

Some error conditions did not have a warning, so all we got is
"Could not initialize rendering context". Which is not helpful to
figure out what is going wrong.
This commit is contained in:
Martin Gräßlin 2016-07-15 08:44:31 +02:00
parent 1c275a02c8
commit 70167b748d

View file

@ -179,8 +179,10 @@ bool EglOnXBackend::initRenderingContext()
setHavePlatformBase(havePlatformBase);
if (havePlatformBase) {
// Make sure that the X11 platform is supported
if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_x11")))
if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_x11"))) {
qCWarning(KWIN_CORE) << "EGL_EXT_platform_base is supported, but EGL_EXT_platform_x11 is not. Cannot create EGLDisplay on X11";
return false;
}
const int attribs[] = {
EGL_PLATFORM_X11_SCREEN_EXT, m_x11ScreenNumber,
@ -192,8 +194,10 @@ bool EglOnXBackend::initRenderingContext()
dpy = eglGetDisplay(m_x11Display);
}
if (dpy == EGL_NO_DISPLAY)
if (dpy == EGL_NO_DISPLAY) {
qCWarning(KWIN_CORE) << "Failed to get the EGLDisplay";
return false;
}
setEglDisplay(dpy);
initEglAPI();