offscreen: always create a valid QPlatformIntegration

Commit f4a66e5c accidentally made it so that the offscreen
plugin would produce a null QPlatformIntegration on
X11 if QT_QPA_OFFSCREEN_NO_GLX is set.

Restore previous logic where the generic QOffscreenIntegration
is created if the X11 code path did not create an object.

Change-Id: Ic71fb04bbd824f4121480dbaf8fa0571ebb39f42
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2020-12-14 13:09:46 +01:00
parent 79cb003020
commit cd6d805d93

View File

@ -321,10 +321,11 @@ QOffscreenIntegration *QOffscreenIntegration::createOffscreenIntegration(const Q
QByteArray glx = qgetenv("QT_QPA_OFFSCREEN_NO_GLX"); QByteArray glx = qgetenv("QT_QPA_OFFSCREEN_NO_GLX");
if (glx.isEmpty()) if (glx.isEmpty())
offscreenIntegration = new QOffscreenX11Integration; offscreenIntegration = new QOffscreenX11Integration;
#else
offscreenIntegration = new QOffscreenIntegration;
#endif #endif
if (!offscreenIntegration)
offscreenIntegration = new QOffscreenIntegration;
offscreenIntegration->configure(paramList); offscreenIntegration->configure(paramList);
return offscreenIntegration; return offscreenIntegration;
} }