Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp

Issue 2147513002: Fix context creation problems in dm (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: add comment about static Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp
diff --git a/tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp b/tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp
index 7429bed630b3adb47c59e9164690421a18c6d88b..a3069dc0285f4ea377857ef55f56fb4d8ef28aa6 100644
--- a/tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp
+++ b/tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp
@@ -184,8 +184,8 @@ GLXGLTestContext::GLXGLTestContext(GrGLStandard forcedGpuAPI, GLXGLTestContext*
if (gluCheckExtension(
reinterpret_cast<const GLubyte*>("GLX_EXT_create_context_es2_profile"),
reinterpret_cast<const GLubyte*>(glxExts))) {
- static const int context_attribs_gles[] = {
- GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+ const int context_attribs_gles[] = {
+ GLX_CONTEXT_MAJOR_VERSION_ARB, 2,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
None
@@ -198,14 +198,17 @@ GLXGLTestContext::GLXGLTestContext(GrGLStandard forcedGpuAPI, GLXGLTestContext*
// to do this nastiness
for (i = NUM_GL_VERSIONS - 2; i > 0 ; i--) {
/* don't bother below GL 3.0 */
- if (gl_versions[i].major == 3 && gl_versions[i].minor == 0) {
+ if (gl_versions[i].major < 3) {
break;
}
// On Nvidia GPUs, to use Nv Path rendering we need a compatibility profile for the
// time being.
// TODO when Nvidia implements NVPR on Core profiles, we should start requesting
// core here
- static const int context_attribs_gl[] = {
+ // Warning: This array should not be set to static. The
+ // glXCreateContextAttribsARB call writes to it upon failure and
+ // the next call would fail too.
+ const int context_attribs_gl[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, gl_versions[i].major,
GLX_CONTEXT_MINOR_VERSION_ARB, gl_versions[i].minor,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
@@ -231,7 +234,7 @@ GLXGLTestContext::GLXGLTestContext(GrGLStandard forcedGpuAPI, GLXGLTestContext*
// implementations will return the newest context version
// compatible with OpenGL versions less than version 3.0.
if (ctxErrorOccurred || !fContext) {
- static const int context_attribs_gl_fallback[] = {
+ const int context_attribs_gl_fallback[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, 1,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
None
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698