summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-07-07 16:59:45 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-07-10 13:26:26 +0200
commit8663ccb039797af9292791dcd8563dc356162471 (patch)
tree3467d8511e241feb9a2739ea171fa629f95463a2 /src/plugins
parentc587e5a4da3a1d5e2b8413fa6cdddc0f0c46d792 (diff)
Add support for querying "eglconfig" through the xcb native interface
We already support this for eglfs but for a desktop Qt configured with -opengl es2 we need to expose it through xcb as well. Change-Id: I36d0e255d8c86cc1cec56015f33470f61d7df466 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp16
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index b381fac5bb..5673d41811 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -79,6 +79,7 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"),
QByteArrayLiteral("connection"), QByteArrayLiteral("screen"),
QByteArrayLiteral("eglcontext"),
+ QByteArrayLiteral("eglconfig"),
QByteArrayLiteral("glxconfig"),
QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"),
QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"),
@@ -241,6 +242,9 @@ void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceSt
case EglContext:
result = eglContextForContext(context);
break;
+ case EglConfig:
+ result = eglConfigForContext(context);
+ break;
case GLXConfig:
result = glxConfigForContext(context);
break;
@@ -462,6 +466,18 @@ void * QXcbNativeInterface::eglContextForContext(QOpenGLContext *context)
#endif
}
+void * QXcbNativeInterface::eglConfigForContext(QOpenGLContext *context)
+{
+ Q_ASSERT(context);
+#if defined(XCB_USE_EGL)
+ QEGLPlatformContext *eglPlatformContext = static_cast<QEGLPlatformContext *>(context->handle());
+ return eglPlatformContext->eglConfig();
+#else
+ Q_UNUSED(context);
+ return 0;
+#endif
+}
+
void *QXcbNativeInterface::glxContextForContext(QOpenGLContext *context)
{
Q_ASSERT(context);
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 01b66a767d..c63cdf0254 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -63,6 +63,7 @@ public:
Connection,
Screen,
EglContext,
+ EglConfig,
GLXConfig,
GLXContext,
AppTime,
@@ -104,6 +105,7 @@ public:
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
static void *eglContextForContext(QOpenGLContext *context);
+ static void *eglConfigForContext(QOpenGLContext *context);
static void *glxContextForContext(QOpenGLContext *context);
static void *glxConfigForContext(QOpenGLContext *context);