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

Unified Diff: client/deps/glbench/src/egl_stuff.cc

Issue 2122020: Fixes for GLES systems. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: ...and removed bogus #-I from Makefile Created 10 years, 7 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 | « client/deps/glbench/src/Makefile ('k') | client/deps/glbench/src/main.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/glbench/src/egl_stuff.cc
diff --git a/client/deps/glbench/src/egl_stuff.cc b/client/deps/glbench/src/egl_stuff.cc
index 7728d4b5fcf314f15e40297d86cd228961d7949b..91d10f9299397681ffdf0aadf0a46c1007d74e11 100644
--- a/client/deps/glbench/src/egl_stuff.cc
+++ b/client/deps/glbench/src/egl_stuff.cc
@@ -39,6 +39,7 @@ XVisualInfo* GetXVisual() {
EGL_DEPTH_SIZE, 1,
EGL_STENCIL_SIZE, 1,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_NONE
};
@@ -59,12 +60,21 @@ XVisualInfo* GetXVisual() {
CHECK_EGL();
}
+ // TODO: for some reason on some systems EGL_NATIVE_VISUAL_ID returns an ID
+ // that XVisualIDFromVisual cannot find. Use default visual until this is
+ // resolved.
+#if 0
EGLint visual_id;
eglGetConfigAttrib(egl_display, egl_config, EGL_NATIVE_VISUAL_ID, &visual_id);
CHECK_EGL();
-
XVisualInfo vinfo_template;
vinfo_template.visualid = static_cast<VisualID>(visual_id);
+#else
+ XVisualInfo vinfo_template;
+ vinfo_template.visualid = XVisualIDFromVisual(DefaultVisual(
+ g_xlib_display, DefaultScreen(g_xlib_display)));
+#endif
+
int nitems = 0;
XVisualInfo* ret = XGetVisualInfo(g_xlib_display, VisualIDMask,
&vinfo_template, &nitems);
@@ -73,8 +83,12 @@ XVisualInfo* GetXVisual() {
}
bool InitContext() {
+ EGLint attribs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
EGLContext egl_context = eglCreateContext(egl_display, egl_config,
- NULL, NULL);
+ NULL, attribs);
CHECK_EGL();
eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);
@@ -83,11 +97,6 @@ bool InitContext() {
eglQuerySurface(egl_display, egl_surface, EGL_WIDTH, &g_width);
eglQuerySurface(egl_display, egl_surface, EGL_HEIGHT, &g_height);
-#ifndef USE_EGL
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-#endif
-
return true;
}
« no previous file with comments | « client/deps/glbench/src/Makefile ('k') | client/deps/glbench/src/main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698