diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-13 15:54:18 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-14 11:38:42 +0000 |
commit | 6046458dee115841c6f01b2a2e01b41be1bfbdc9 (patch) | |
tree | a46a5e71329abe557fb996e01b0186b953a37239 /src/platformsupport/eglconvenience/qeglplatformcontext.cpp | |
parent | b63c3d4d9a8917a84cf24439a0f75a17df0aafee (diff) |
eglfs: Handle custom platform window implementations better
Backends may want to subclass QEglFSWindow and reimplement resetSurface()
and similar. Make it possible to do this by moving window creation to
the device integration interface, similarly to screens.
In addition to customizing the windows, some backends may want to disable
the dependency on surfaceless contexts when using offscreen windows
(i.e. pbuffer surfaces). Make this possible too.
Change-Id: Ic5a426e07f821c7a800217b8799f91770ba6a6d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformcontext.cpp')
-rw-r--r-- | src/platformsupport/eglconvenience/qeglplatformcontext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 2de7fb3b40..acd6197ed5 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -106,11 +106,12 @@ QT_BEGIN_NAMESPACE #endif QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, - EGLConfig *config, const QVariant &nativeHandle) + EGLConfig *config, const QVariant &nativeHandle, Flags flags) : m_eglDisplay(display) , m_swapInterval(-1) , m_swapIntervalEnvChecked(false) , m_swapIntervalFromEnv(-1) + , m_flags(flags) { if (nativeHandle.isNull()) { m_eglConfig = config ? *config : q_configFromGLFormat(display, format); @@ -291,7 +292,7 @@ void QEGLPlatformContext::updateFormatFromGL() // drivers (Mesa) when certain attributes are present (multisampling). EGLSurface tempSurface = EGL_NO_SURFACE; EGLContext tempContext = EGL_NO_CONTEXT; - if (!q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context")) + if (m_flags.testFlag(NoSurfaceless) || !q_hasEglExtension(m_eglDisplay, "EGL_KHR_surfaceless_context")) tempSurface = createTemporaryOffscreenSurface(); EGLBoolean ok = eglMakeCurrent(m_eglDisplay, tempSurface, tempSurface, m_eglContext); |