diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-25 16:53:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-18 09:16:03 +0100 |
commit | d29aabbca9c98eb66d9cde6058ad96929c816c23 (patch) | |
tree | 4c6fc78f766d492f7f7cca9ca0bb591002c38767 /src/platformsupport/eglconvenience/qeglplatformcontext.cpp | |
parent | ac9ab9703ff299c94dca7585d5a12ecde28931bb (diff) |
eglfs: Introduce way of filtering out unwanted EGL configs.
Some times a platform might want to exclude certain configs, for example
based on EGL_NATIVE_VISUAL_ID. This patch introduces a new
QEglConfigChooser class which has a virtual filterConfig() function
which can be re-implemented in a sub-class to give finer control of how
configs are chosen.
Change-Id: I8b684f01be95a47307b1e429857f01337a9a38d8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 16 |
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; |