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

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

Issue 2602563002: Refactor DrawTextureQuad and CheckPixels in gl_tests util (Closed)
Patch Set: rebase only Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 #include <GLES3/gl3.h> 8 #include <GLES3/gl3.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 glClear(GL_COLOR_BUFFER_BIT); 180 glClear(GL_COLOR_BUFFER_BIT);
181 glDrawArrays(GL_TRIANGLES, 0, 6); 181 glDrawArrays(GL_TRIANGLES, 0, 6);
182 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); 182 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
183 // Verify. 183 // Verify.
184 uint8_t color[4]; 184 uint8_t color[4];
185 BlendEquationFuncAdd<GL_SRC1_COLOR_EXT, GL_SRC_ALPHA, 185 BlendEquationFuncAdd<GL_SRC1_COLOR_EXT, GL_SRC_ALPHA,
186 GL_ONE_MINUS_SRC1_COLOR_EXT, 186 GL_ONE_MINUS_SRC1_COLOR_EXT,
187 GL_ONE_MINUS_SRC1_ALPHA_EXT>(kDst, kSrc, kSrc1, color); 187 GL_ONE_MINUS_SRC1_ALPHA_EXT>(kDst, kSrc, kSrc1, color);
188 188
189 EXPECT_TRUE(GLTestHelper::CheckPixels(kWidth / 4, (3 * kHeight) / 4, 1, 1, 189 EXPECT_TRUE(GLTestHelper::CheckPixels(kWidth / 4, (3 * kHeight) / 4, 1, 1,
190 1, color)); 190 1, color, nullptr));
191 EXPECT_TRUE(GLTestHelper::CheckPixels(kWidth - 1, 0, 1, 1, 1, color)); 191 EXPECT_TRUE(
192 GLTestHelper::CheckPixels(kWidth - 1, 0, 1, 1, 1, color, nullptr));
192 } 193 }
193 194
194 protected: 195 protected:
195 GLuint program_; 196 GLuint program_;
196 GLuint position_loc_; 197 GLuint position_loc_;
197 GLuint src_loc_; 198 GLuint src_loc_;
198 GLuint src1_loc_; 199 GLuint src1_loc_;
199 GLManager gl_; 200 GLManager gl_;
200 }; 201 };
201 202
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 683
683 INSTANTIATE_TEST_CASE_P(TranslatorVariants, 684 INSTANTIATE_TEST_CASE_P(TranslatorVariants,
684 EXTBlendFuncExtendedDrawTest, 685 EXTBlendFuncExtendedDrawTest,
685 ::testing::Bool()); 686 ::testing::Bool());
686 687
687 INSTANTIATE_TEST_CASE_P(TranslatorVariants, 688 INSTANTIATE_TEST_CASE_P(TranslatorVariants,
688 EXTBlendFuncExtendedES3DrawTest, 689 EXTBlendFuncExtendedES3DrawTest,
689 ::testing::Bool()); 690 ::testing::Bool());
690 691
691 } // namespace gpu 692 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc ('k') | gpu/command_buffer/tests/gl_ext_srgb_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698