summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-10-10 14:45:42 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-10-13 10:00:45 +0200
commit6c35eb5f0ff17d02166ca144eef8792acf2acd63 (patch)
tree2ab4823e711fc83afdab6bfb7bcf78316a01f535 /src/platformsupport/eglconvenience
parentcd824ee79188b889df85d4d648a625589655e15e (diff)
eglconvenience/eglfs: Clean up warning messages
Remove the last occurrence of ifdefed debug prints and replace it with categorized logging. Also clean up the warning texts for some of the serious errors, the old ones from Qt 4 times were somewhat messy. Change-Id: I2a3e48c393d56be2511d25c3003b1f2b74ac3c8c Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience')
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp2
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp8
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformwindow.cpp2
-rw-r--r--src/platformsupport/eglconvenience/qxlibeglintegration.cpp34
4 files changed, 21 insertions, 25 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index d7b5527a9f..b7f4c55d3d 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -303,7 +303,7 @@ EGLConfig QEglConfigChooser::chooseConfig()
} while (q_reduceConfigAttributes(&configureAttributes));
if (!cfg)
- qWarning("Cant find EGLConfig, returning null config");
+ qWarning("Cannot find EGLConfig, returning null config");
return cfg;
}
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 07ef202195..d7c4fd6764 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -177,7 +177,7 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont
}
if (m_eglContext == EGL_NO_CONTEXT) {
- qWarning("QEGLPlatformContext::init: eglError: %x, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: Failed to create context: %x", eglGetError());
return;
}
@@ -357,7 +357,7 @@ bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
eglSwapInterval(eglDisplay(), m_swapInterval);
}
} else {
- qWarning("QEGLPlatformContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
}
return ok;
@@ -376,7 +376,7 @@ void QEGLPlatformContext::doneCurrent()
eglBindAPI(m_api);
bool ok = eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!ok)
- qWarning("QEGLPlatformContext::doneCurrent(): eglError: %d, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglMakeCurrent failed: %x", eglGetError());
}
void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
@@ -385,7 +385,7 @@ void QEGLPlatformContext::swapBuffers(QPlatformSurface *surface)
EGLSurface eglSurface = eglSurfaceForPlatformSurface(surface);
bool ok = eglSwapBuffers(m_eglDisplay, eglSurface);
if (!ok)
- qWarning("QEGLPlatformContext::swapBuffers(): eglError: %d, this: %p \n", eglGetError(), this);
+ qWarning("QEGLPlatformContext: eglSwapBuffers failed: %x", eglGetError());
}
void (*QEGLPlatformContext::getProcAddress(const QByteArray &procName)) ()
diff --git a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp b/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
index 39edec4811..af4c907e85 100644
--- a/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformwindow.cpp
@@ -122,7 +122,7 @@ WId QEGLPlatformWindow::winId() const
void QEGLPlatformWindow::setOpacity(qreal)
{
if (!isRaster())
- qWarning("eglfs: Cannot set opacity for non-raster windows");
+ qWarning("QEGLPlatformWindow: Cannot set opacity for non-raster windows");
// Nothing to do here. The opacity is stored in the QWindow.
}
diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
index ff7e6ce271..439189d1b4 100644
--- a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
+++ b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp
@@ -31,8 +31,11 @@
**
****************************************************************************/
+#include <QLoggingCategory>
#include "qxlibeglintegration_p.h"
+Q_LOGGING_CATEGORY(lcXlibEglDebug, "qt.egl.xlib.debug")
+
VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config)
{
VisualID visualId = 0;
@@ -87,31 +90,26 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay
// configs. In such a case we have to fall back to XGetVisualInfo.
if (!visualMatchesConfig) {
visualId = 0;
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- qWarning("Warning: EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d (%d %d %d %d), but this is incompatible",
- (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth,
- configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize);
-#endif
+ qCWarning(lcXlibEglDebug,
+ "EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d"
+ "(%d %d %d %d), but this is incompatible",
+ (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth,
+ configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize);
}
} else {
- qWarning("Warning: EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID",
- (int)visualId, configId);
+ qCWarning(lcXlibEglDebug, "EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID",
+ (int)visualId, configId);
visualId = 0;
}
XFree(chosenVisualInfo);
}
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
else
- qDebug("EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
-#endif
+ qCDebug(lcXlibEglDebug, "EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId);
if (visualId) {
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- if (configAlphaSize > 0)
- qDebug("Using ARGB Visual ID %d provided by EGL for config %d", (int)visualId, configId);
- else
- qDebug("Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
-#endif
+ qCDebug(lcXlibEglDebug, configAlphaSize > 0
+ ? "Using ARGB Visual ID %d provided by EGL for config %d"
+ : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId);
return visualId;
}
@@ -143,9 +141,7 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay
}
if (visualId) {
-#ifdef QT_DEBUG_X11_VISUAL_SELECTION
- qDebug("Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
-#endif
+ qCDebug(lcXlibEglDebug, "Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId);
return visualId;
}