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

Side by Side Diff: ui/gl/test/gl_image_test_template.h

Issue 1709443002: Clear IOSurfaces immediately after creating them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 4 years, 10 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
« no previous file with comments | « ui/gfx/mac/io_surface.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 // This file defines tests that implementations of GLImage should pass in order 5 // This file defines tests that implementations of GLImage should pass in order
6 // to be conformant. 6 // to be conformant.
7 7
8 #ifndef UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ 8 #ifndef UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
9 #define UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ 9 #define UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // GLImage in order to be conformant. 162 // GLImage in order to be conformant.
163 REGISTER_TYPED_TEST_CASE_P(GLImageTest, CreateAndDestroy); 163 REGISTER_TYPED_TEST_CASE_P(GLImageTest, CreateAndDestroy);
164 164
165 template <typename GLImageTestDelegate> 165 template <typename GLImageTestDelegate>
166 class GLImageZeroInitializeTest : public GLImageTest<GLImageTestDelegate> {}; 166 class GLImageZeroInitializeTest : public GLImageTest<GLImageTestDelegate> {};
167 167
168 // This test verifies that if an uninitialized image is bound to a texture, the 168 // This test verifies that if an uninitialized image is bound to a texture, the
169 // result is zero-initialized. 169 // result is zero-initialized.
170 TYPED_TEST_CASE_P(GLImageZeroInitializeTest); 170 TYPED_TEST_CASE_P(GLImageZeroInitializeTest);
171 171
172 // TODO(erikchen): Enable this test when it actually passes on Mac. 172 TYPED_TEST_P(GLImageZeroInitializeTest, ZeroInitialize) {
173 // https://crbug.com/584760.
174 TYPED_TEST_P(GLImageZeroInitializeTest, DISABLED_ZeroInitialize) {
175 const gfx::Size image_size(256, 256); 173 const gfx::Size image_size(256, 256);
176 scoped_refptr<gl::GLImage> image = this->delegate_.CreateImage(image_size); 174 scoped_refptr<gl::GLImage> image = this->delegate_.CreateImage(image_size);
177 GLenum target = this->delegate_.GetTextureTarget(); 175 GLenum target = this->delegate_.GetTextureTarget();
178 GLuint uninitialized_texture = GLTestHelper::CreateTexture(target); 176 GLuint uninitialized_texture = GLTestHelper::CreateTexture(target);
179 177
180 glBindTexture(target, uninitialized_texture); 178 glBindTexture(target, uninitialized_texture);
181 ASSERT_TRUE(image->BindTexImage(target)); 179 ASSERT_TRUE(image->BindTexImage(target));
182 GLuint framebuffer = 180 GLuint framebuffer =
183 GLTestHelper::SetupFramebuffer(image_size.width(), image_size.height()); 181 GLTestHelper::SetupFramebuffer(image_size.width(), image_size.height());
184 ASSERT_TRUE(framebuffer); 182 ASSERT_TRUE(framebuffer);
(...skipping 13 matching lines...) Expand all
198 glDeleteShader(pas.vertex_shader); 196 glDeleteShader(pas.vertex_shader);
199 glDeleteShader(pas.fragment_shader); 197 glDeleteShader(pas.fragment_shader);
200 glDeleteBuffersARB(1, &vertex_buffer); 198 glDeleteBuffersARB(1, &vertex_buffer);
201 glDeleteFramebuffersEXT(1, &framebuffer); 199 glDeleteFramebuffersEXT(1, &framebuffer);
202 200
203 image->ReleaseTexImage(target); 201 image->ReleaseTexImage(target);
204 image->Destroy(true); 202 image->Destroy(true);
205 glDeleteTextures(1, &uninitialized_texture); 203 glDeleteTextures(1, &uninitialized_texture);
206 } 204 }
207 205
208 REGISTER_TYPED_TEST_CASE_P(GLImageZeroInitializeTest, DISABLED_ZeroInitialize); 206 REGISTER_TYPED_TEST_CASE_P(GLImageZeroInitializeTest, ZeroInitialize);
209 207
210 template <typename GLImageTestDelegate> 208 template <typename GLImageTestDelegate>
211 class GLImageCopyTest : public GLImageTest<GLImageTestDelegate> {}; 209 class GLImageCopyTest : public GLImageTest<GLImageTestDelegate> {};
212 210
213 TYPED_TEST_CASE_P(GLImageCopyTest); 211 TYPED_TEST_CASE_P(GLImageCopyTest);
214 212
215 TYPED_TEST_P(GLImageCopyTest, CopyTexImage) { 213 TYPED_TEST_P(GLImageCopyTest, CopyTexImage) {
216 const gfx::Size image_size(256, 256); 214 const gfx::Size image_size(256, 256);
217 // These values are picked so that RGB -> YUV on the CPU converted 215 // These values are picked so that RGB -> YUV on the CPU converted
218 // back to RGB on the GPU produces the original RGB values without 216 // back to RGB on the GPU produces the original RGB values without
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 image->Destroy(true); 269 image->Destroy(true);
272 } 270 }
273 271
274 // The GLImageCopyTest test case verifies that the GLImage implementation 272 // The GLImageCopyTest test case verifies that the GLImage implementation
275 // handles CopyTexImage correctly. 273 // handles CopyTexImage correctly.
276 REGISTER_TYPED_TEST_CASE_P(GLImageCopyTest, CopyTexImage); 274 REGISTER_TYPED_TEST_CASE_P(GLImageCopyTest, CopyTexImage);
277 275
278 } // namespace gl 276 } // namespace gl
279 277
280 #endif // UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_ 278 #endif // UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
OLDNEW
« no previous file with comments | « ui/gfx/mac/io_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698