summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfsintegration.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-09-16 14:12:54 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-10-10 08:36:47 +0200
commit1f040d401d322cec9dc56c93e78899a429cb6e5a (patch)
treea604b60b9964f098dd07e66204abd7b564e5f3d8 /src/plugins/platforms/eglfs/qeglfsintegration.cpp
parent881ceeff428c377d02ae3881beccdbb028385075 (diff)
eglfs: Add support for systems without pbuffer support
Use a small native window and window surface in case the hooks indicate that pbuffer support is not available. Change-Id: I6515309041f0e1e2f5321d59941f35d6ee16dca7 Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 6fe3893922..16a113691f 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -36,6 +36,7 @@
#include "qeglfswindow.h"
#include "qeglfshooks.h"
#include "qeglfscontext.h"
+#include "qeglfsoffscreenwindow.h"
#include <QtGui/private/qguiapplication_p.h>
@@ -116,9 +117,9 @@ QEGLPlatformContext *QEglFSIntegration::createContext(const QSurfaceFormat &form
QSurfaceFormat adjustedFormat = QEglFSHooks::hooks()->surfaceFormatFor(format);
if (!nativeHandle || nativeHandle->isNull()) {
EGLConfig config = QEglFSIntegration::chooseConfig(display, adjustedFormat);
- ctx = new QEglFSContext(adjustedFormat, shareContext, display, &config, QVariant());
+ ctx = new QEglFSContext(adjustedFormat, shareContext, display, &config, QVariant());
} else {
- ctx = new QEglFSContext(adjustedFormat, shareContext, display, 0, *nativeHandle);
+ ctx = new QEglFSContext(adjustedFormat, shareContext, display, 0, *nativeHandle);
}
*nativeHandle = QVariant::fromValue<QEGLNativeContext>(QEGLNativeContext(ctx->eglContext(), display));
return ctx;
@@ -128,7 +129,13 @@ QPlatformOffscreenSurface *QEglFSIntegration::createOffscreenSurface(EGLDisplay
const QSurfaceFormat &format,
QOffscreenSurface *surface) const
{
- return new QEGLPbuffer(display, QEglFSHooks::hooks()->surfaceFormatFor(format), surface);
+ QSurfaceFormat fmt = QEglFSHooks::hooks()->surfaceFormatFor(format);
+ if (QEglFSHooks::hooks()->supportsPBuffers())
+ return new QEGLPbuffer(display, fmt, surface);
+ else
+ return new QEglFSOffscreenWindow(display, fmt, surface);
+
+ // Never return null. Multiple QWindows are not supported by this plugin.
}
QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) const