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

Unified Diff: gpu/command_buffer/tests/gl_test_utils.cc

Issue 12542009: Revert "Revert 186416" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.h ('k') | gpu/gpu.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_test_utils.cc
diff --git a/gpu/command_buffer/tests/gl_test_utils.cc b/gpu/command_buffer/tests/gl_test_utils.cc
index 1a3e7c2f2635ced90aa8b0bb975c4700dca48864..4b87f1e6a2d23ce84060cba44af6ba8885b4edf5 100644
--- a/gpu/command_buffer/tests/gl_test_utils.cc
+++ b/gpu/command_buffer/tests/gl_test_utils.cc
@@ -108,6 +108,24 @@ GLuint GLTestHelper::SetupUnitQuad(GLint position_location) {
return vbo;
}
+GLuint GLTestHelper::SetupColorsForUnitQuad(
+ GLint location, const GLfloat color[4], GLenum usage) {
+ GLuint vbo = 0;
+ glGenBuffers(1, &vbo);
+ glBindBuffer(GL_ARRAY_BUFFER, vbo);
+ GLfloat vertices[6 * 4];
+ for (int ii = 0; ii < 6; ++ii) {
+ for (int jj = 0; jj < 4; ++jj) {
+ vertices[ii * 4 + jj] = color[jj];
+ }
+ }
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, usage);
+ glEnableVertexAttribArray(location);
+ glVertexAttribPointer(location, 4, GL_FLOAT, GL_FALSE, 0, 0);
+
+ return vbo;
+}
+
bool GLTestHelper::CheckPixels(
GLint x, GLint y, GLsizei width, GLsizei height, GLint tolerance,
const uint8* color) {
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.h ('k') | gpu/gpu.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698