summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-06-12 18:16:42 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-06-16 14:38:48 +0200
commit1f3cc8c2618979b557d60ef1ad984a49dca83bff (patch)
tree6c79bb825432be51346482074749f5b0dd440997
parent7ef833ced4e3c2dee086078b4cec3fa2e15472e5 (diff)
<chromium> Only enable robustness if the shared context is using it
Chromium currently assumes that all GLContexts are checking the availability of robustness on the system through the same code path. Since we're passing it a context created by Qt, and that Qt never uses EGL_EXT_create_context_robustness, the context creation fails when trying to share a non-robustness-enabled context with one that does. Fix the issue by asking the shared GLContext if it was allocated using the extension, Chromium's contexts currently always return true and the Qt context will return false. This relies on the fact that the Qt context is always the first one added to the ShareGroup and that it is going to be the one queried, but this should be reasonably reliable. Change-Id: I6456429db678f077cd8a72032711361da01e72ea Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rw-r--r--chromium/ui/gl/gl_context_egl.cc3
-rw-r--r--chromium/ui/gl/gl_context_glx.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/chromium/ui/gl/gl_context_egl.cc b/chromium/ui/gl/gl_context_egl.cc
index cd6b534d403..1793d045bd8 100644
--- a/chromium/ui/gl/gl_context_egl.cc
+++ b/chromium/ui/gl/gl_context_egl.cc
@@ -52,7 +52,8 @@ bool GLContextEGL::Initialize(
config_ = compatible_surface->GetConfig();
const EGLint* context_attributes = NULL;
- if (GLSurfaceEGL::IsCreateContextRobustnessSupported()) {
+ if (GLSurfaceEGL::IsCreateContextRobustnessSupported()
+ && (!share_group()->GetContext() || share_group()->GetContext()->WasAllocatedUsingRobustnessExtension())) {
DVLOG(1) << "EGL_EXT_create_context_robustness supported.";
context_attributes = kContextRobustnessAttributes;
} else {
diff --git a/chromium/ui/gl/gl_context_glx.cc b/chromium/ui/gl/gl_context_glx.cc
index 407d60048f4..7b8277caac1 100644
--- a/chromium/ui/gl/gl_context_glx.cc
+++ b/chromium/ui/gl/gl_context_glx.cc
@@ -53,7 +53,8 @@ bool GLContextGLX::Initialize(
if (GLSurfaceGLX::IsCreateContextSupported()) {
DVLOG(1) << "GLX_ARB_create_context supported.";
std::vector<int> attribs;
- if (GLSurfaceGLX::IsCreateContextRobustnessSupported()) {
+ if (GLSurfaceGLX::IsCreateContextRobustnessSupported()
+ && (!share_group()->GetContext() || share_group()->GetContext()->WasAllocatedUsingRobustnessExtension())) {
DVLOG(1) << "GLX_ARB_create_context_robustness supported.";
attribs.push_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB);
attribs.push_back(GLX_LOSE_CONTEXT_ON_RESET_ARB);