summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@digia.com>2014-04-01 11:44:26 +0300
committerIikka Eklund <iikka.eklund@digia.com>2014-04-01 11:44:27 +0300
commit0ab63b035a649dc1982c867cd37d466d249004b9 (patch)
tree6de22edcd3957aae3eee698136a000e52ab7f8fe /src/platformsupport/eglconvenience
parenta6f8aa0ae1d5a1d1099df1891ea60b14b6eb6065 (diff)
parent0cb2c760c219514849ab0f6be8e5368f92dfa5d9 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/platformsupport/eglconvenience')
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp15
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp39
2 files changed, 15 insertions, 39 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index 7cf1f88b02..e6624fb9ff 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -82,16 +82,7 @@ QVector<EGLint> q_createConfigAttributesFromFormat(const QSurfaceFormat &format)
// put in the list before 32-bit configs. So, to make sure 16-bit is preffered over 32-bit,
// we must set the red/green/blue sizes to zero. This has an unfortunate consequence that
// if the application sets the red/green/blue size to 5/6/5 on the QSurfaceFormat,
- // they will probably get a 32-bit config, even when there's an RGB565 config available.
-
-// // Now normalize the values so -1 becomes 0
-// redSize = redSize > 0 ? redSize : 0;
-// greenSize = greenSize > 0 ? greenSize : 0;
-// blueSize = blueSize > 0 ? blueSize : 0;
-// alphaSize = alphaSize > 0 ? alphaSize : 0;
-// depthSize = depthSize > 0 ? depthSize : 0;
-// stencilSize = stencilSize > 0 ? stencilSize : 0;
-// sampleCount = sampleCount > 0 ? sampleCount : 0;
+ // they might still get a 32-bit config, even when there's an RGB565 config available.
QVector<EGLint> configAttributes;
@@ -446,11 +437,9 @@ void q_printEglConfig(EGLDisplay display, EGLConfig config)
for (index = 0; attrs[index].attr != -1; ++index) {
EGLint value;
if (eglGetConfigAttrib(display, config, attrs[index].attr, &value)) {
- qWarning("\t%s: %d\n", attrs[index].name, (int)value);
+ qDebug("\t%s: %d", attrs[index].name, (int)value);
}
}
-
- qWarning("\n");
}
#ifdef Q_OS_LINUX
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 9c3b9b539c..eec6463c21 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -44,6 +44,7 @@
#include "qeglpbuffer_p.h"
#include <qpa/qplatformwindow.h>
#include <QOpenGLContext>
+#include <QDebug>
QT_BEGIN_NAMESPACE
@@ -191,6 +192,12 @@ void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLCont
return;
}
+ static const bool printConfig = qgetenv("QT_QPA_EGLFS_DEBUG").toInt();
+ if (printConfig) {
+ qDebug() << "Created context for format" << format << "with config:";
+ q_printEglConfig(m_eglDisplay, m_eglConfig);
+ }
+
#ifndef QT_NO_OPENGL
// Make the context current to ensure the GL version query works. This needs a surface too.
const EGLint pbufferAttributes[] = {
@@ -261,37 +268,15 @@ bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
return true;
}
- bool ok = eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_eglContext);
- if (!ok)
- qWarning("QEGLPlatformContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
-#ifdef QEGL_EXTRA_DEBUG
- static bool showDebug = true;
- if (showDebug) {
- showDebug = false;
- const char *str = (const char*)glGetString(GL_VENDOR);
- qWarning("Vendor %s\n", str);
- str = (const char*)glGetString(GL_RENDERER);
- qWarning("Renderer %s\n", str);
- str = (const char*)glGetString(GL_VERSION);
- qWarning("Version %s\n", str);
-
- str = (const char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
- qWarning("Extensions %s\n",str);
-
- str = (const char*)glGetString(GL_EXTENSIONS);
- qWarning("Extensions %s\n", str);
-
- }
-#endif
-
+ const bool ok = eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_eglContext);
if (ok) {
if (!m_swapIntervalEnvChecked) {
m_swapIntervalEnvChecked = true;
if (qEnvironmentVariableIsSet("QT_QPA_EGLFS_SWAPINTERVAL")) {
QByteArray swapIntervalString = qgetenv("QT_QPA_EGLFS_SWAPINTERVAL");
- bool ok;
- const int swapInterval = swapIntervalString.toInt(&ok);
- if (ok)
+ bool intervalOk;
+ const int swapInterval = swapIntervalString.toInt(&intervalOk);
+ if (intervalOk)
m_swapIntervalFromEnv = swapInterval;
}
}
@@ -302,6 +287,8 @@ bool QEGLPlatformContext::makeCurrent(QPlatformSurface *surface)
m_swapInterval = requestedSwapInterval;
eglSwapInterval(eglDisplay(), m_swapInterval);
}
+ } else {
+ qWarning("QEGLPlatformContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
}
return ok;