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

Side by Side Diff: gpu/command_buffer/tests/gl_test_utils.cc

Issue 2537343008: Revert of Add command buffer support for EXT_sRGB_write_control (Closed)
Patch Set: Created 4 years 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 | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 "gpu/command_buffer/tests/gl_test_utils.h" 5 #include "gpu/command_buffer/tests/gl_test_utils.h"
6 6
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 static_cast<double>(size.height()), 64 static_cast<double>(size.height()),
65 kFragmentShader) 65 kFragmentShader)
66 .c_str()); 66 .c_str());
67 default: 67 default:
68 NOTREACHED(); 68 NOTREACHED();
69 return 0; 69 return 0;
70 } 70 }
71 } 71 }
72 72
73 bool GLTestHelper::HasExtension(const char* extension) { 73 bool GLTestHelper::HasExtension(const char* extension) {
74 // Pad with an extra space to ensure that |extension| is not a substring of 74 std::string extensions(
75 // another extension. 75 reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
76 std::string extensions = 76 return extensions.find(extension) != std::string::npos;
77 std::string(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))) +
78 " ";
79 std::string extension_padded = std::string(extension) + " ";
80 return extensions.find(extension_padded) != std::string::npos;
81 } 77 }
82 78
83 bool GLTestHelper::CheckGLError(const char* msg, int line) { 79 bool GLTestHelper::CheckGLError(const char* msg, int line) {
84 bool success = true; 80 bool success = true;
85 GLenum error = GL_NO_ERROR; 81 GLenum error = GL_NO_ERROR;
86 while ((error = glGetError()) != GL_NO_ERROR) { 82 while ((error = glGetError()) != GL_NO_ERROR) {
87 success = false; 83 success = false;
88 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), error) 84 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), error)
89 << "GL ERROR in " << msg << " at line " << line << " : " << error; 85 << "GL ERROR in " << msg << " at line " << line << " : " << error;
90 } 86 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 ASSERT_NE(vertex_buffer, 0u); 352 ASSERT_NE(vertex_buffer, 0u);
357 glUniform1i(sampler_location, 0); 353 glUniform1i(sampler_location, 0);
358 354
359 glDrawArrays(GL_TRIANGLES, 0, 6); 355 glDrawArrays(GL_TRIANGLES, 0, 6);
360 356
361 glDeleteShader(vertex_shader); 357 glDeleteShader(vertex_shader);
362 glDeleteShader(fragment_shader); 358 glDeleteShader(fragment_shader);
363 glDeleteProgram(program); 359 glDeleteProgram(program);
364 glDeleteBuffers(1, &vertex_buffer); 360 glDeleteBuffers(1, &vertex_buffer);
365 } 361 }
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698