summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qglxintegration.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-02-08 20:05:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-18 13:42:22 +0100
commitc7a51f1858a8cac5cdc458b575df1f0e064e3853 (patch)
tree341033260dcd90b4e87ab47b009c4f17da55f777 /src/plugins/platforms/xcb/qglxintegration.h
parentf8fdeb68b6e1a710438fc9084a2a3b1b9b6744fa (diff)
Added QOffscreenSurface class.
Inherits QSurface and allows to use OpenGL from an arbitrary thread. Platform plugins can implement QPlatformOffscreenSurface, otherwise an invisible QWindow is used by QOffscreenSurface. This patch includes an implementation of QOffscreenSurface for XCB and EglFS platform plugins using pbuffers. Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qglxintegration.h')
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h
index 78e9985334..d10b1d441b 100644
--- a/src/plugins/platforms/xcb/qglxintegration.h
+++ b/src/plugins/platforms/xcb/qglxintegration.h
@@ -46,6 +46,7 @@
#include "qxcbscreen.h"
#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qplatformoffscreensurface.h>
#include <QtGui/QSurfaceFormat>
#include <QtCore/QMutex>
@@ -89,6 +90,25 @@ private:
GLXContext m_context;
GLXContext m_shareContext;
QSurfaceFormat m_format;
+ bool m_isPBufferCurrent;
+};
+
+
+class QGLXPbuffer : public QPlatformOffscreenSurface
+{
+public:
+ explicit QGLXPbuffer(QOffscreenSurface *offscreenSurface);
+ ~QGLXPbuffer();
+
+ QSurfaceFormat format() const { return m_format; }
+ bool isValid() const { return m_pbuffer != 0; }
+
+ GLXPbuffer pbuffer() const { return m_pbuffer; }
+
+private:
+ QSurfaceFormat m_format;
+ QXcbScreen *m_screen;
+ GLXPbuffer m_pbuffer;
};
QT_END_NAMESPACE