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

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

Issue 1732030: Replaced funky state machines with classes. This is in preparation of doing the same to gl_Bench. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: Got rid of static test list initialization, fixed USE_EGL. 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 unified diff | 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 »
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "main.h" 8 #include "main.h"
9 #include "xlib_window.h" 9 #include "xlib_window.h"
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 EGLContext egl_context = eglCreateContext(egl_display, egl_config, 76 EGLContext egl_context = eglCreateContext(egl_display, egl_config,
77 NULL, NULL); 77 NULL, NULL);
78 CHECK_EGL(); 78 CHECK_EGL();
79 79
80 eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context); 80 eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);
81 CHECK_EGL(); 81 CHECK_EGL();
82 82
83 eglQuerySurface(egl_display, egl_surface, EGL_WIDTH, &g_width); 83 eglQuerySurface(egl_display, egl_surface, EGL_WIDTH, &g_width);
84 eglQuerySurface(egl_display, egl_surface, EGL_HEIGHT, &g_height); 84 eglQuerySurface(egl_display, egl_surface, EGL_HEIGHT, &g_height);
85 85
86 #ifndef USE_EGL
86 glMatrixMode(GL_MODELVIEW); 87 glMatrixMode(GL_MODELVIEW);
87 glLoadIdentity(); 88 glLoadIdentity();
89 #endif
88 90
89 return true; 91 return true;
90 } 92 }
91 93
92 void DestroyContext() { 94 void DestroyContext() {
93 eglMakeCurrent(egl_display, NULL, NULL, NULL); 95 eglMakeCurrent(egl_display, NULL, NULL, NULL);
94 eglDestroyContext(egl_display, egl_context); 96 eglDestroyContext(egl_display, egl_context);
95 } 97 }
96 98
97 void TerminateGL() { 99 void TerminateGL() {
98 eglDestroySurface(egl_display, egl_surface); 100 eglDestroySurface(egl_display, egl_surface);
99 eglTerminate(egl_display); 101 eglTerminate(egl_display);
100 } 102 }
101 103
102 void SwapBuffers() { 104 void SwapBuffers() {
103 eglSwapBuffers(egl_display, egl_surface); 105 eglSwapBuffers(egl_display, egl_surface);
104 } 106 }
105 107
106 bool SwapInterval(int interval) { 108 bool SwapInterval(int interval) {
107 return eglSwapInterval(egl_display, interval) == EGL_TRUE; 109 return eglSwapInterval(egl_display, interval) == EGL_TRUE;
108 } 110 }
OLDNEW
« 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