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

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

Issue 2602563002: Refactor DrawTextureQuad and CheckPixels in gl_tests util (Closed)
Patch Set: rebase only Created 3 years, 12 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_program_unittest.cc ('k') | gpu/command_buffer/tests/gl_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_stream_draw_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_stream_draw_unittest.cc b/gpu/command_buffer/tests/gl_stream_draw_unittest.cc
index 9722f02e41a09530aa317097076bfe16985193dc..7bbae743f903b78801351ecaee2e890188ab60ed 100644
--- a/gpu/command_buffer/tests/gl_stream_draw_unittest.cc
+++ b/gpu/command_buffer/tests/gl_stream_draw_unittest.cc
@@ -77,10 +77,12 @@ TEST_F(GLStreamDrawTest, Basic) {
GLTestHelper::SetupUnitQuad(position_loc);
GLTestHelper::SetupColorsForUnitQuad(color_loc, float_red, GL_STREAM_DRAW);
glDrawArrays(GL_TRIANGLES, 0, 6);
- EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red));
+ EXPECT_TRUE(
+ GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red, nullptr));
GLTestHelper::SetupColorsForUnitQuad(color_loc, float_green, GL_STATIC_DRAW);
glDrawArrays(GL_TRIANGLES, 0, 6);
- EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green));
+ EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green,
+ nullptr));
GLTestHelper::CheckGLError("no errors", __LINE__);
}
@@ -109,14 +111,16 @@ TEST_F(GLStreamDrawTest, DrawElements) {
static GLubyte indices[] = { 0, 1, 2, 3, 4, 5, };
glBufferData(
GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STREAM_DRAW);
- glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, NULL);
- EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red));
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, nullptr);
+ EXPECT_TRUE(
+ GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red, nullptr));
GLTestHelper::SetupColorsForUnitQuad(color_loc, float_green, GL_STATIC_DRAW);
glBufferData(
GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
- glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, NULL);
- EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green));
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, nullptr);
+ EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green,
+ nullptr));
GLTestHelper::CheckGLError("no errors", __LINE__);
}
@@ -156,12 +160,13 @@ TEST_F(GLStreamDrawTest, VertexArrayObjects) {
for (int ii = 0; ii < 2; ++ii) {
glBindVertexArrayOES(vaos[0]);
glDrawArrays(GL_TRIANGLES, 0, 6);
- EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red));
+ EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_red,
+ nullptr));
glBindVertexArrayOES(vaos[1]);
glDrawArrays(GL_TRIANGLES, 0, 6);
- EXPECT_TRUE(
- GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green));
+ EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green,
+ nullptr));
}
GLTestHelper::CheckGLError("no errors", __LINE__);
« no previous file with comments | « gpu/command_buffer/tests/gl_program_unittest.cc ('k') | gpu/command_buffer/tests/gl_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698