summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 78dc1f7e9b..0b11d96e5c 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -64,8 +64,22 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform
: m_eglDisplay(display)
, m_eglApi(eglApi)
, m_eglConfig(q_configFromGLFormat(display, format, true))
- , m_format(q_glFormatFromConfig(display, m_eglConfig))
{
+ init(format, share);
+}
+
+QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
+ EGLConfig config, EGLenum eglApi)
+ : m_eglDisplay(display)
+ , m_eglApi(eglApi)
+ , m_eglConfig(config)
+{
+ init(format, share);
+}
+
+void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLContext *share)
+{
+ m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig);
m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : 0;
QVector<EGLint> contextAttrs;