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

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

Issue 1938493002: [Reland] Fix ReadPixels from float fbo buffer in ES2/WebGL1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 GLint compile_status = 0; 134 GLint compile_status = 0;
135 glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status); 135 glGetShaderiv(shader, GL_COMPILE_STATUS, &compile_status);
136 if (compile_status != GL_TRUE) { 136 if (compile_status != GL_TRUE) {
137 glDeleteShader(shader); 137 glDeleteShader(shader);
138 shader = 0; 138 shader = 0;
139 } 139 }
140 140
141 return shader; 141 return shader;
142 } 142 }
143 143
144 TEST_F(GLReadbackTest, ReadPixelsFloat) { 144 // TODO(zmo): ReadPixels with float type isn't implemented in ANGLE ES2
145 // backend. crbug.com/607283.
146 // TODO(zmo): This test also fails on some android devices when the readback
147 // type is HALF_FLOAT_OES. Likely it's due to a driver bug. crbug.com/607936.
Zhenyao Mo 2016/04/29 18:16:48 This is the added part from the original CL: in th
148 #if defined(OS_WIN) || defined(OS_ANDROID)
149 #define MAYBE_ReadPixelsFloat DISABLED_ReadPixelsFloat
150 #else
151 #define MAYBE_ReadPixelsFloat ReadPixelsFloat
152 #endif
153 TEST_F(GLReadbackTest, MAYBE_ReadPixelsFloat) {
145 const GLsizei kTextureSize = 4; 154 const GLsizei kTextureSize = 4;
146 const GLfloat kDrawColor[4] = { -10.9f, 0.5f, 10.5f, 100.12f }; 155 const GLfloat kDrawColor[4] = { -10.9f, 0.5f, 10.5f, 100.12f };
147 const GLfloat kEpsilon = 0.01f; 156 const GLfloat kEpsilon = 0.01f;
148 157
149 struct TestFormat { 158 struct TestFormat {
150 GLint format; 159 GLint format;
151 GLint type; 160 GLint type;
152 uint32_t comp_count; 161 uint32_t comp_count;
153 }; 162 };
154 TestFormat test_formats[4]; 163 TestFormat test_formats[4];
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 322
314 glDeleteFramebuffers(1, &framebuffer); 323 glDeleteFramebuffers(1, &framebuffer);
315 glDeleteTextures(1, &texture_id); 324 glDeleteTextures(1, &texture_id);
316 } 325 }
317 326
318 glDeleteBuffers(1, &vertex_buffer); 327 glDeleteBuffers(1, &vertex_buffer);
319 glDeleteProgram(program); 328 glDeleteProgram(program);
320 } 329 }
321 330
322 } // namespace gpu 331 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698