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

Side by Side Diff: client/deps/glbench/src/egl_stuff.cc

Issue 1208001: Renamed globals xlib_* to g_xlib_*. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | client/deps/glbench/src/glx_stuff.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <EGL/egl.h> 5 #include <EGL/egl.h>
6 6
7 #include "main.h" 7 #include "main.h"
8 #include "xlib_window.h" 8 #include "xlib_window.h"
9 9
10 10
11 static EGLDisplay egl_display = NULL; 11 static EGLDisplay egl_display = NULL;
12 static EGLConfig egl_config = NULL; 12 static EGLConfig egl_config = NULL;
13 static EGLSurface egl_surface = NULL; 13 static EGLSurface egl_surface = NULL;
14 static EGLContext egl_context = NULL; 14 static EGLContext egl_context = NULL;
15 15
16 #define CHECK_EGL() do { \ 16 #define CHECK_EGL() do { \
17 if (eglGetError() != EGL_SUCCESS) return false; \ 17 if (eglGetError() != EGL_SUCCESS) return false; \
18 } while (0) 18 } while (0)
19 19
20 bool Init() { 20 bool Init() {
21 if (!XlibInit()) 21 if (!XlibInit())
22 return false; 22 return false;
23 23
24 EGLNativeWindowType native_window = 24 EGLNativeWindowType native_window =
25 static_cast<EGLNativeWindowType>(xlib_window); 25 static_cast<EGLNativeWindowType>(g_xlib_window);
26 egl_surface = eglCreateWindowSurface(egl_display, egl_config, 26 egl_surface = eglCreateWindowSurface(egl_display, egl_config,
27 native_window, NULL); 27 native_window, NULL);
28 CHECK_EGL(); 28 CHECK_EGL();
29 return true; 29 return true;
30 } 30 }
31 31
32 VisualID GetVisualID() { 32 VisualID GetVisualID() {
33 EGLint attribs[] = { 33 EGLint attribs[] = {
34 EGL_RED_SIZE, 1, 34 EGL_RED_SIZE, 1,
35 EGL_GREEN_SIZE, 1, 35 EGL_GREEN_SIZE, 1,
36 EGL_BLUE_SIZE, 1, 36 EGL_BLUE_SIZE, 1,
37 EGL_DEPTH_SIZE, 1, 37 EGL_DEPTH_SIZE, 1,
38 EGL_STENCIL_SIZE, 1, 38 EGL_STENCIL_SIZE, 1,
39 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 39 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
40 EGL_NONE 40 EGL_NONE
41 }; 41 };
42 42
43 EGLNativeDisplayType native_display = 43 EGLNativeDisplayType native_display =
44 static_cast<EGLNativeDisplayType>(xlib_display); 44 static_cast<EGLNativeDisplayType>(g_xlib_display);
45 45
46 EGLDisplay egl_display = eglGetDisplay(native_display); 46 EGLDisplay egl_display = eglGetDisplay(native_display);
47 CHECK_EGL(); 47 CHECK_EGL();
48 48
49 eglInitialize(egl_display, NULL, NULL); 49 eglInitialize(egl_display, NULL, NULL);
50 CHECK_EGL(); 50 CHECK_EGL();
51 51
52 EGLint num_configs = -1; 52 EGLint num_configs = -1;
53 eglGetConfigs(egl_display, NULL, 0, &num_configs); 53 eglGetConfigs(egl_display, NULL, 0, &num_configs);
54 CHECK_EGL(); 54 CHECK_EGL();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 eglTerminate(egl_display); 91 eglTerminate(egl_display);
92 } 92 }
93 93
94 void SwapBuffers() { 94 void SwapBuffers() {
95 eglSwapBuffers(egl_display, egl_surface); 95 eglSwapBuffers(egl_display, egl_surface);
96 } 96 }
97 97
98 bool SwapInterval(int interval) { 98 bool SwapInterval(int interval) {
99 return eglSwapInterval(egl_display, interval) == EGL_TRUE; 99 return eglSwapInterval(egl_display, interval) == EGL_TRUE;
100 } 100 }
OLDNEW
« no previous file with comments | « no previous file | client/deps/glbench/src/glx_stuff.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698