Fix incorrect surface type in offscreen plugin

In case we use glx backend set correct surface.

Task-number: QTBUG-63346
Change-Id: I5827bf5b8e4ed60b933c25ce234fdd4a3dd20c88
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Michal Klocek 2019-02-08 13:51:05 +01:00
parent 48f5b671a3
commit 652e9146ac
1 changed files with 7 additions and 0 deletions

View File

@ -87,6 +87,7 @@ bool QOffscreenX11Integration::hasCapability(QPlatformIntegration::Capability ca
switch (cap) {
case OpenGL: return true;
case ThreadedOpenGL: return true;
case RasterGLSurface: return true;
default: return QOffscreenIntegration::hasCapability(cap);
}
}
@ -196,6 +197,12 @@ QOffscreenX11GLXContext::QOffscreenX11GLXContext(QOffscreenX11Info *x11, QOpenGL
d->x11 = x11;
d->format = context->format();
if (d->format.renderableType() == QSurfaceFormat::DefaultRenderableType)
d->format.setRenderableType(QSurfaceFormat::OpenGL);
if (d->format.renderableType() != QSurfaceFormat::OpenGL)
return;
d->shareContext = 0;
if (context->shareHandle())
d->shareContext = static_cast<QOffscreenX11GLXContext *>(context->shareHandle())->d->context;