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>bb10
parent
cd824ee791
commit
6c35eb5f0f
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)) ()
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ QSize QEglFSX11Hooks::screenSize() const
|
|||
m_screenSize = QSize(env.at(0).toInt(), env.at(1).toInt());
|
||||
} else {
|
||||
m_screenSize = QSize(640, 480);
|
||||
qDebug("EGLFS_X11_SIZE not set, falling back to 640x480");
|
||||
qWarning("EGLFS_X11_SIZE not set, falling back to 640x480");
|
||||
}
|
||||
}
|
||||
return m_screenSize;
|
||||
|
|
|
|||
Loading…
Reference in New Issue