diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-04-24 16:40:22 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-09 13:24:55 +0200 |
commit | 0b5c0ad2ef49a262de5bdb18a3cdab30ae6772a2 (patch) | |
tree | 19f2d2fc25c22ea628bb7be0874488f69b33593f /src/platformsupport/eglconvenience/qeglplatformcontext_p.h | |
parent | 3b6d8ba49b39b75dda33fb3c3a784330791efed2 (diff) |
Support adopting an existing EGLContext in eglfs and xcb
Add also a manual test application. For GLX there is an autotest since
that is likely to be run on one of the CIs. For EGL and especially
eglfs this is likely not the case so a manual test is better.
Task-number: QTBUG-37552
Change-Id: Ib09db5d909befb68d16f69abd401a56abe55f28a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext_p.h')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcontext_p.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h index 714633c3bc..82f062c4a4 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h +++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h @@ -44,6 +44,7 @@ #include <qpa/qplatformwindow.h> #include <qpa/qplatformopenglcontext.h> +#include <QtCore/QVariant> #include <EGL/egl.h> QT_BEGIN_NAMESPACE @@ -51,9 +52,8 @@ QT_BEGIN_NAMESPACE class QEGLPlatformContext : public QPlatformOpenGLContext { public: - QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display); QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, - EGLConfig config); + EGLConfig *config = 0, const QVariant &nativeHandle = QVariant()); ~QEGLPlatformContext(); bool makeCurrent(QPlatformSurface *surface); @@ -74,6 +74,8 @@ protected: private: void init(const QSurfaceFormat &format, QPlatformOpenGLContext *share); + void adopt(const QVariant &nativeHandle, QPlatformOpenGLContext *share); + void updateFormatFromGL(); EGLContext m_eglContext; EGLContext m_shareContext; @@ -84,6 +86,7 @@ private: int m_swapInterval; bool m_swapIntervalEnvChecked; int m_swapIntervalFromEnv; + bool m_ownsContext; }; QT_END_NAMESPACE |