summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/kms/qkmsintegration.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-09-26 14:07:31 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-09-30 18:23:08 +0200
commit684990d1481b0858489596dc7b28310bb87a6dfa (patch)
tree29f6b2df7a35d610e71315cdc01e2a8b82ba9380 /src/plugins/platforms/kms/qkmsintegration.h
parent3a2fdc48ad1066eb043f83024ddd76098f933d3a (diff)
kms: Support QOpenGLWidget and QQuickWidget
Also fixes the handling of shareContext() for contexts and format() for windows and makes QOffscreenSurface working. Change-Id: I3c3374a9de14a5b8428de3e11d9d7e1285c5b9c7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms/kms/qkmsintegration.h')
-rw-r--r--src/plugins/platforms/kms/qkmsintegration.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h
index b13fbb2793..3ca2510e68 100644
--- a/src/plugins/platforms/kms/qkmsintegration.h
+++ b/src/plugins/platforms/kms/qkmsintegration.h
@@ -36,7 +36,9 @@
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformoffscreensurface.h>
#include <QtPlatformSupport/private/qdevicediscovery_p.h>
+#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
@@ -44,6 +46,24 @@ class QKmsScreen;
class QKmsDevice;
class QFbVtHandler;
+class QKmsOffscreenWindow : public QPlatformOffscreenSurface
+{
+public:
+ QKmsOffscreenWindow(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface);
+ ~QKmsOffscreenWindow();
+
+ QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
+ bool isValid() const Q_DECL_OVERRIDE { return m_surface != EGL_NO_SURFACE; }
+
+ EGLSurface surface() const { return m_surface; }
+
+private:
+ QSurfaceFormat m_format;
+ EGLDisplay m_display;
+ EGLSurface m_surface;
+ EGLNativeWindowType m_window;
+};
+
class QKmsIntegration : public QObject, public QPlatformIntegration
{
Q_OBJECT
@@ -58,6 +78,7 @@ public:
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;