summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-05-23 15:04:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-23 23:55:43 +0200
commit47e8352a00fb46945ed7bcfd2abfe66a8ae36992 (patch)
treeeb4770739ee46ac6d53852e4e7263c9ea99f768f /src/platformsupport/eglconvenience/qeglplatformcontext.cpp
parentf3ad57e90ecc33f3d4de7bf8d612abc0ccb2fb6e (diff)
QEGLPlatformContext: Add accessors for display and config.
Change-Id: I4a7c033691ed83698ac161c034f795f1ac3b0ade Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 97b4571dbf..d8ee996215 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -51,11 +51,9 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform
EGLenum eglApi)
: m_eglDisplay(display)
, m_eglApi(eglApi)
- , m_format(format)
+ , m_eglConfig(q_configFromGLFormat(display, format, true))
+ , m_format(q_glFormatFromConfig(display, m_eglConfig))
{
- EGLConfig config = q_configFromGLFormat(display, format, true);
- m_format = q_glFormatFromConfig(display, config);
-
m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : 0;
QVector<EGLint> contextAttrs;
@@ -64,10 +62,10 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform
contextAttrs.append(EGL_NONE);
eglBindAPI(m_eglApi);
- m_eglContext = eglCreateContext(m_eglDisplay, config, m_shareContext, contextAttrs.constData());
+ m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, m_shareContext, contextAttrs.constData());
if (m_eglContext == EGL_NO_CONTEXT && m_shareContext != EGL_NO_CONTEXT) {
m_shareContext = 0;
- m_eglContext = eglCreateContext(m_eglDisplay, config, 0, contextAttrs.constData());
+ m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, 0, contextAttrs.constData());
}
}
@@ -157,3 +155,13 @@ EGLContext QEGLPlatformContext::eglContext() const
{
return m_eglContext;
}
+
+EGLDisplay QEGLPlatformContext::eglDisplay() const
+{
+ return m_eglDisplay;
+}
+
+EGLConfig QEGLPlatformContext::eglConfig() const
+{
+ return m_eglConfig;
+}