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>bb10
parent
c587e5a4da
commit
8663ccb039
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue