kwin/egl: whitespace

This commit is contained in:
Fredrik Höglund 2013-03-13 16:28:45 +01:00
parent d116ef6655
commit e9c5ab8c91

View file

@ -122,9 +122,11 @@ bool EglOnXBackend::initRenderingContext()
dpy = eglGetDisplay(display()); dpy = eglGetDisplay(display());
if (dpy == EGL_NO_DISPLAY) if (dpy == EGL_NO_DISPLAY)
return false; return false;
EGLint major, minor; EGLint major, minor;
if (eglInitialize(dpy, &major, &minor) == EGL_FALSE) if (eglInitialize(dpy, &major, &minor) == EGL_FALSE)
return false; return false;
#ifdef KWIN_HAVE_OPENGLES #ifdef KWIN_HAVE_OPENGLES
eglBindAPI(EGL_OPENGL_ES_API); eglBindAPI(EGL_OPENGL_ES_API);
#else #else
@ -133,13 +135,16 @@ bool EglOnXBackend::initRenderingContext()
return false; return false;
} }
#endif #endif
initBufferConfigs(); initBufferConfigs();
if (!overlayWindow()->create()) { if (!overlayWindow()->create()) {
kError(1212) << "Could not get overlay window"; kError(1212) << "Could not get overlay window";
return false; return false;
} else { } else {
overlayWindow()->setup(None); overlayWindow()->setup(None);
} }
surface = eglCreateWindowSurface(dpy, config, overlayWindow()->window(), 0); surface = eglCreateWindowSurface(dpy, config, overlayWindow()->window(), 0);
const EGLint context_attribs[] = { const EGLint context_attribs[] = {
@ -150,20 +155,25 @@ bool EglOnXBackend::initRenderingContext()
}; };
ctx = eglCreateContext(dpy, config, EGL_NO_CONTEXT, context_attribs); ctx = eglCreateContext(dpy, config, EGL_NO_CONTEXT, context_attribs);
if (ctx == EGL_NO_CONTEXT) { if (ctx == EGL_NO_CONTEXT) {
kError(1212) << "Create Context failed"; kError(1212) << "Create Context failed";
return false; return false;
} }
if (eglMakeCurrent(dpy, surface, surface, ctx) == EGL_FALSE) { if (eglMakeCurrent(dpy, surface, surface, ctx) == EGL_FALSE) {
kError(1212) << "Make Context Current failed"; kError(1212) << "Make Context Current failed";
return false; return false;
} }
kDebug(1212) << "EGL version: " << major << "." << minor; kDebug(1212) << "EGL version: " << major << "." << minor;
EGLint error = eglGetError(); EGLint error = eglGetError();
if (error != EGL_SUCCESS) { if (error != EGL_SUCCESS) {
kWarning(1212) << "Error occurred while creating context " << error; kWarning(1212) << "Error occurred while creating context " << error;
return false; return false;
} }
return true; return true;
} }