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

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

Issue 2123013: Split tests into individual files. Got rid of globals by converting them to classes. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: addressed comments 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/swaptest.cc ('k') | client/deps/glbench/src/testbase.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 <gflags/gflags.h> 5 #include <gflags/gflags.h>
6 #include <map> 6 #include <map>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <time.h> 10 #include <time.h>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 GLuint texture = GenerateAndBindTexture(); 185 GLuint texture = GenerateAndBindTexture();
186 186
187 GLfloat vertices[8] = { 187 GLfloat vertices[8] = {
188 0.f, 0.f, 188 0.f, 0.f,
189 1.f, 0.f, 189 1.f, 0.f,
190 0.f, 1.f, 190 0.f, 1.f,
191 1.f, 1.f, 191 1.f, 1.f,
192 }; 192 };
193 193
194 GLuint program = InitShaderProgram(vertex_shader, fragment_shader); 194 GLuint program = glbench::InitShaderProgram(vertex_shader, fragment_shader);
195 int attribute_index = glGetAttribLocation(program, "c"); 195 int attribute_index = glGetAttribLocation(program, "c");
196 glVertexAttribPointer(attribute_index, 2, GL_FLOAT, GL_FALSE, 0, vertices); 196 glVertexAttribPointer(attribute_index, 2, GL_FLOAT, GL_FALSE, 0, vertices);
197 glEnableVertexAttribArray(attribute_index); 197 glEnableVertexAttribArray(attribute_index);
198 198
199 int texture_sampler = glGetUniformLocation(program, "tex"); 199 int texture_sampler = glGetUniformLocation(program, "tex");
200 glUniform1f(texture_sampler, 0); 200 glUniform1f(texture_sampler, 0);
201 201
202 // UniformTest needs a uniform from the shader program. Get the uniform 202 // UniformTest needs a uniform from the shader program. Get the uniform
203 // and instantiate the test. 203 // and instantiate the test.
204 Test* uniform_test = GetUniformTest(glGetUniformLocation(program, "shift")); 204 Test* uniform_test = GetUniformTest(glGetUniformLocation(program, "shift"));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 t->Stop(); 252 t->Stop();
253 } 253 }
254 254
255 // TODO: cleaner teardown. 255 // TODO: cleaner teardown.
256 256
257 glDeleteTextures(1, &texture); 257 glDeleteTextures(1, &texture);
258 DestroyContext(); 258 DestroyContext();
259 return return_code; 259 return return_code;
260 } 260 }
OLDNEW
« no previous file with comments | « client/deps/glbench/src/swaptest.cc ('k') | client/deps/glbench/src/testbase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698