Chromium Code Reviews| Index: ui/gl/test/gl_image_test_template.h |
| diff --git a/ui/gl/test/gl_image_test_template.h b/ui/gl/test/gl_image_test_template.h |
| index fc09d428bc7b0f5fbd79e0b866c06a068ed05ece..3a79a417002454b2a6837d09ed64676d5bc9f195 100644 |
| --- a/ui/gl/test/gl_image_test_template.h |
| +++ b/ui/gl/test/gl_image_test_template.h |
| @@ -17,6 +17,7 @@ |
| #include "ui/gfx/buffer_types.h" |
| #include "ui/gl/gl_bindings.h" |
| #include "ui/gl/gl_context.h" |
| +#include "ui/gl/gl_helper.h" |
| #include "ui/gl/gl_image.h" |
| #include "ui/gl/gl_implementation.h" |
| #include "ui/gl/gl_surface.h" |
| @@ -89,7 +90,10 @@ TYPED_TEST_CASE_P(GLImageCopyTest); |
| TYPED_TEST_P(GLImageCopyTest, CopyTexImage) { |
| const Size image_size(256, 256); |
| - const uint8_t image_color[] = {0xff, 0xff, 0, 0xff}; |
| + // This values are picked so that RGB -> YUV on the CPU converted |
|
reveman
2015/11/01 14:19:05
nit: "These values.."
Daniele Castagna
2015/11/01 21:55:31
Done.
|
| + // back to RGB on the GPU produces the original RGB values without |
| + // any error. |
| + const uint8_t image_color[] = {0x10, 0x20, 0, 0xff}; |
| const uint8_t texture_color[] = {0, 0, 0xff, 0xff}; |
| GLuint framebuffer = |
| @@ -112,7 +116,7 @@ TYPED_TEST_P(GLImageCopyTest, CopyTexImage) { |
| image_size.width(), image_size.height(), |
| static_cast<int>(RowSizeForBufferFormat(image_size.width(), |
| BufferFormat::RGBA_8888, 0)), |
| - BufferFormat::RGBA_8888, texture_color, pixels.get()); |
| + 0, BufferFormat::RGBA_8888, texture_color, pixels.get()); |
| // Note: This test assume that |image| can be used with GL_TEXTURE_2D but |
| // that might not be the case for some GLImage implementations. |
| glBindTexture(GL_TEXTURE_2D, texture); |
| @@ -145,15 +149,14 @@ TYPED_TEST_P(GLImageCopyTest, CopyTexImage) { |
| ); |
| // clang-format on |
| - GLuint vertex_shader = |
| - GLTestHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader); |
| + GLuint vertex_shader = GLHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader); |
| bool is_gles = GetGLImplementation() == kGLImplementationEGLGLES2; |
| - GLuint fragment_shader = GLTestHelper::LoadShader( |
| + GLuint fragment_shader = GLHelper::LoadShader( |
| GL_FRAGMENT_SHADER, |
| base::StringPrintf("%s%s", is_gles ? kShaderFloatPrecision : "", |
| kFragmentShader) |
| .c_str()); |
| - GLuint program = GLTestHelper::SetupProgram(vertex_shader, fragment_shader); |
| + GLuint program = GLHelper::SetupProgram(vertex_shader, fragment_shader); |
| EXPECT_NE(program, 0u); |
| glUseProgram(program); |