summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/platform/egl/qeglplatformcontext.cpp15
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp6
2 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
index e56504833d1..350968b87d4 100644
--- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
+++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
@@ -104,6 +104,14 @@ QT_BEGIN_NAMESPACE
#define GL_LOSE_CONTEXT_ON_RESET 0x8252
#endif
+// Constants from GL_EXT_robustness.
+#ifndef GL_RESET_NOTIFICATION_STRATEGY_EXT
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
+#endif
+#ifndef GL_LOSE_CONTEXT_ON_RESET_EXT
+#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
+#endif
+
// Constants from EGL_NV_robustness_video_memory_purge
#ifndef EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV
#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C
@@ -452,11 +460,16 @@ void QEGLPlatformContext::updateFormatFromGL()
}
}
}
- if (hasExtension("GL_ARB_robustness")) {
+ if (m_format.renderableType() == QSurfaceFormat::OpenGL && hasExtension("GL_ARB_robustness")) {
GLint value = 0;
glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY, &value);
if (value == GL_LOSE_CONTEXT_ON_RESET)
m_format.setOption(QSurfaceFormat::ResetNotification);
+ } else if (m_format.renderableType() == QSurfaceFormat::OpenGLES && hasExtension("GL_EXT_robustness")) {
+ GLint value = 0;
+ glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_EXT, &value);
+ if (value == GL_LOSE_CONTEXT_ON_RESET_EXT)
+ m_format.setOption(QSurfaceFormat::ResetNotification);
}
}
runGLChecks();
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 6b45d26fb4c..cb927d7c296 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -192,6 +192,12 @@ QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context)
qWarning("QOpenGLFunctions created with non-current context");
}
+/*!
+ \class QOpenGLExtensions
+ \inmodule QtGui
+ \internal
+*/
+
QOpenGLExtensions::QOpenGLExtensions()
{
}