diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-04-16 13:03:46 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-04-16 15:24:35 +0000 |
commit | 15ebee1c10a954ea2408e35e53fa8307defc3970 (patch) | |
tree | 37a760b9f44034c93f229652196bef15fab5cbf1 /src/core/ozone | |
parent | aef55c4091f252231718369b382dd8f401f206e3 (diff) |
Pass robustness support on to Chromium when supported
Change-Id: Ie34d36601efc743432202c2ad1f40e9837530b5e
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/ozone')
-rw-r--r-- | src/core/ozone/gl_context_qt.cpp | 8 | ||||
-rw-r--r-- | src/core/ozone/gl_context_qt.h | 2 | ||||
-rw-r--r-- | src/core/ozone/gl_surface_egl_qt.cpp | 2 | ||||
-rw-r--r-- | src/core/ozone/gl_surface_glx_qt.cpp | 2 |
4 files changed, 12 insertions, 2 deletions
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp index c4a075544..ad298dff1 100644 --- a/src/core/ozone/gl_context_qt.cpp +++ b/src/core/ozone/gl_context_qt.cpp @@ -163,6 +163,14 @@ QFunctionPointer GLContextHelper::getEglGetProcAddress() return get_proc_address; } +bool GLContextHelper::isCreateContextRobustnessSupported() +{ +#if QT_CONFIG(opengl) + if (QOpenGLContext *context = qt_gl_global_share_context()) + return context->format().testOption(QSurfaceFormat::ResetNotification); +#endif + return false; +} QT_END_NAMESPACE #if defined(OS_WIN) diff --git a/src/core/ozone/gl_context_qt.h b/src/core/ozone/gl_context_qt.h index 59ee567aa..8559af313 100644 --- a/src/core/ozone/gl_context_qt.h +++ b/src/core/ozone/gl_context_qt.h @@ -64,6 +64,8 @@ public: static void* getNativeDisplay(); static QFunctionPointer getGlXGetProcAddress(); static QFunctionPointer getEglGetProcAddress(); + static bool isCreateContextRobustnessSupported(); + private: Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs); diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp index 8715a5095..33dd5745f 100644 --- a/src/core/ozone/gl_surface_egl_qt.cpp +++ b/src/core/ozone/gl_surface_egl_qt.cpp @@ -128,7 +128,7 @@ EGLDisplay GLSurfaceEGL::GetHardwareDisplay() bool GLSurfaceEGL::IsCreateContextRobustnessSupported() { - return false; + return GLContextHelper::isCreateContextRobustnessSupported() && HasEGLExtension("EGL_EXT_create_context_robustness"); } bool GLSurfaceEGL::IsCreateContextBindGeneratesResourceSupported() diff --git a/src/core/ozone/gl_surface_glx_qt.cpp b/src/core/ozone/gl_surface_glx_qt.cpp index 24772889f..e150c940a 100644 --- a/src/core/ozone/gl_surface_glx_qt.cpp +++ b/src/core/ozone/gl_surface_glx_qt.cpp @@ -68,7 +68,7 @@ bool GLSurfaceGLX::IsCreateContextSupported() bool GLSurfaceGLX::IsCreateContextRobustnessSupported() { - return false; // ExtensionsContain(g_extensions, "GLX_ARB_create_context_robustness"); + return GLContextHelper::isCreateContextRobustnessSupported() && HasGLXExtension("GLX_ARB_create_context_robustness"); } bool GLSurfaceGLX::IsEXTSwapControlSupported() |