| 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 ff995e7312c4ee053042a31d3d5cbaabb05d5915..82a1ae7593b065af408a96fd00e4361563046590 100644
|
| --- a/client/deps/glbench/src/xlib_window.cc
|
| +++ b/client/deps/glbench/src/xlib_window.cc
|
| @@ -2,14 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/logging.h"
|
| #include "main.h"
|
| #include "xlib_window.h"
|
| -#include "base/logging.h"
|
|
|
|
|
| -Display *xlib_display = NULL;
|
| -Window xlib_window = 0;
|
| -XVisualInfo *xlib_visinfo = NULL;
|
| +Display *g_xlib_display = NULL;
|
| +Window g_xlib_window = 0;
|
| +XVisualInfo *g_xlib_visinfo = NULL;
|
|
|
| GLint g_width = 512;
|
| GLint g_height = 512;
|
| @@ -17,15 +17,15 @@ bool g_override_redirect = true;
|
|
|
|
|
| bool XlibInit() {
|
| - xlib_display = XOpenDisplay(0);
|
| - if (!xlib_display)
|
| + g_xlib_display = XOpenDisplay(0);
|
| + if (!g_xlib_display)
|
| return false;
|
|
|
| - int screen = DefaultScreen(xlib_display);
|
| - Window root_window = RootWindow(xlib_display, screen);
|
| + int screen = DefaultScreen(g_xlib_display);
|
| + Window root_window = RootWindow(g_xlib_display, screen);
|
|
|
| XWindowAttributes attributes;
|
| - XGetWindowAttributes(xlib_display, root_window, &attributes);
|
| + XGetWindowAttributes(g_xlib_display, root_window, &attributes);
|
|
|
| g_width = g_width == -1 ? attributes.width : g_width;
|
| g_height = g_height == -1 ? attributes.height : g_height;
|
| @@ -34,8 +34,8 @@ bool XlibInit() {
|
| memset(&vinfo_template, sizeof(vinfo_template), 0);
|
| vinfo_template.visualid = GetVisualID();
|
| int nitems;
|
| - xlib_visinfo = XGetVisualInfo(xlib_display,
|
| - VisualIDMask, &vinfo_template, &nitems);
|
| + g_xlib_visinfo = XGetVisualInfo(g_xlib_display,
|
| + VisualIDMask, &vinfo_template, &nitems);
|
| CHECK(nitems == 1);
|
|
|
| unsigned long mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask |
|
| @@ -43,18 +43,19 @@ bool XlibInit() {
|
| XSetWindowAttributes attr;
|
| attr.background_pixel = 0;
|
| attr.border_pixel = 0;
|
| - attr.colormap = XCreateColormap(xlib_display, root_window,
|
| - xlib_visinfo->visual, AllocNone);
|
| + attr.colormap = XCreateColormap(g_xlib_display, root_window,
|
| + g_xlib_visinfo->visual, AllocNone);
|
| attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
| attr.override_redirect = g_override_redirect ? True : False;
|
| - xlib_window = XCreateWindow(xlib_display, root_window,
|
| - 0, 0, g_width, g_height, 0, xlib_visinfo->depth,
|
| - InputOutput, xlib_visinfo->visual, mask, &attr);
|
| + 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);
|
|
|
| - XMapWindow(xlib_display, xlib_window);
|
| - XSync(xlib_display, True);
|
| + XMapWindow(g_xlib_display, g_xlib_window);
|
| + XSync(g_xlib_display, True);
|
|
|
| - XGetWindowAttributes(xlib_display, xlib_window, &attributes);
|
| + XGetWindowAttributes(g_xlib_display, g_xlib_window, &attributes);
|
| g_width = attributes.width;
|
| g_height = attributes.height;
|
|
|
|
|