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

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

Issue 1219003: Store GLXFBConfig and get X visual ID from it. (Closed)
Patch Set: Don't redeclare variables. Created 10 years, 9 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/xlib_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/glbench/src/xlib_window.cc
diff --git a/client/deps/glbench/src/xlib_window.cc b/client/deps/glbench/src/xlib_window.cc
index 82a1ae7593b065af408a96fd00e4361563046590..0958b5c552164caf10b5c525d59cacdaca554a07 100644
--- a/client/deps/glbench/src/xlib_window.cc
+++ b/client/deps/glbench/src/xlib_window.cc
@@ -9,7 +9,6 @@
Display *g_xlib_display = NULL;
Window g_xlib_window = 0;
-XVisualInfo *g_xlib_visinfo = NULL;
GLint g_width = 512;
GLint g_height = 512;
@@ -29,14 +28,7 @@ bool XlibInit() {
g_width = g_width == -1 ? attributes.width : g_width;
g_height = g_height == -1 ? attributes.height : g_height;
-
- XVisualInfo vinfo_template;
- memset(&vinfo_template, sizeof(vinfo_template), 0);
- vinfo_template.visualid = GetVisualID();
- int nitems;
- g_xlib_visinfo = XGetVisualInfo(g_xlib_display,
- VisualIDMask, &vinfo_template, &nitems);
- CHECK(nitems == 1);
+ XVisualInfo* xlib_visinfo = GetXVisual();
unsigned long mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask |
CWOverrideRedirect;
@@ -44,13 +36,13 @@ bool XlibInit() {
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap(g_xlib_display, root_window,
- g_xlib_visinfo->visual, AllocNone);
+ xlib_visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.override_redirect = g_override_redirect ? True : False;
g_xlib_window = XCreateWindow(g_xlib_display, root_window,
0, 0, g_width, g_height, 0,
- g_xlib_visinfo->depth, InputOutput,
- g_xlib_visinfo->visual, mask, &attr);
+ xlib_visinfo->depth, InputOutput,
+ xlib_visinfo->visual, mask, &attr);
XMapWindow(g_xlib_display, g_xlib_window);
XSync(g_xlib_display, True);
@@ -59,5 +51,7 @@ bool XlibInit() {
g_width = attributes.width;
g_height = attributes.height;
+ XFree(xlib_visinfo);
+
return true;
}
« no previous file with comments | « client/deps/glbench/src/xlib_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698