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

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

Issue 1927593005: 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 #if defined(OS_WIN)
147 #define MAYBE_ReadPixelsFloat DISABLED_ReadPixelsFloat
148 #else
149 #define MAYBE_ReadPixelsFloat ReadPixelsFloat
150 #endif
151 TEST_F(GLReadbackTest, MAYBE_ReadPixelsFloat) {
145 const GLsizei kTextureSize = 4; 152 const GLsizei kTextureSize = 4;
146 const GLfloat kDrawColor[4] = { -10.9f, 0.5f, 10.5f, 100.12f }; 153 const GLfloat kDrawColor[4] = { -10.9f, 0.5f, 10.5f, 100.12f };
147 const GLfloat kEpsilon = 0.01f; 154 const GLfloat kEpsilon = 0.01f;
148 155
149 struct TestFormat { 156 struct TestFormat {
150 GLint format; 157 GLint format;
151 GLint type; 158 GLint type;
152 uint32_t comp_count; 159 uint32_t comp_count;
153 }; 160 };
154 TestFormat test_formats[4]; 161 TestFormat test_formats[4];
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 320
314 glDeleteFramebuffers(1, &framebuffer); 321 glDeleteFramebuffers(1, &framebuffer);
315 glDeleteTextures(1, &texture_id); 322 glDeleteTextures(1, &texture_id);
316 } 323 }
317 324
318 glDeleteBuffers(1, &vertex_buffer); 325 glDeleteBuffers(1, &vertex_buffer);
319 glDeleteProgram(program); 326 glDeleteProgram(program);
320 } 327 }
321 328
322 } // namespace gpu 329 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698