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

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

Issue 1832923002: Clean up calls to CreateGpuMemoryBufferImageCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef GL_GLEXT_PROTOTYPES 5 #ifndef GL_GLEXT_PROTOTYPES
6 #define GL_GLEXT_PROTOTYPES 6 #define GL_GLEXT_PROTOTYPES
7 #endif 7 #endif
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 TEST_F(GLIOSurfaceReadbackWorkaroundTest, ReadPixels) { 49 TEST_F(GLIOSurfaceReadbackWorkaroundTest, ReadPixels) {
50 int width = 1; 50 int width = 1;
51 int height = 1; 51 int height = 1;
52 GLuint source_texture = 0; 52 GLuint source_texture = 0;
53 GLenum source_target = GL_TEXTURE_RECTANGLE_ARB; 53 GLenum source_target = GL_TEXTURE_RECTANGLE_ARB;
54 glGenTextures(1, &source_texture); 54 glGenTextures(1, &source_texture);
55 glBindTexture(source_target, source_texture); 55 glBindTexture(source_target, source_texture);
56 glTexParameteri(source_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 56 glTexParameteri(source_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
57 glTexParameteri(source_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 57 glTexParameteri(source_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
58 GLuint image_id = glCreateGpuMemoryBufferImageCHROMIUM( 58 GLuint image_id = glCreateGpuMemoryBufferImageCHROMIUM(
59 width, height, GL_BGRA_EXT, GL_READ_WRITE_CHROMIUM); 59 width, height, GL_RGBA, GL_READ_WRITE_CHROMIUM);
60 ASSERT_NE(0u, image_id); 60 ASSERT_NE(0u, image_id);
61 glBindTexImage2DCHROMIUM(source_target, image_id); 61 glBindTexImage2DCHROMIUM(source_target, image_id);
62 62
63 GLuint framebuffer = 0; 63 GLuint framebuffer = 0;
64 glGenFramebuffers(1, &framebuffer); 64 glGenFramebuffers(1, &framebuffer);
65 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); 65 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
66 glFramebufferTexture2D( 66 glFramebufferTexture2D(
67 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, source_target, source_texture, 0); 67 GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, source_target, source_texture, 0);
68 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), 68 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
69 glCheckFramebufferStatus(GL_FRAMEBUFFER)); 69 glCheckFramebufferStatus(GL_FRAMEBUFFER));
(...skipping 12 matching lines...) Expand all
82 82
83 glReleaseTexImage2DCHROMIUM(source_target, image_id); 83 glReleaseTexImage2DCHROMIUM(source_target, image_id);
84 glDestroyImageCHROMIUM(image_id); 84 glDestroyImageCHROMIUM(image_id);
85 glDeleteTextures(1, &source_texture); 85 glDeleteTextures(1, &source_texture);
86 glDeleteFramebuffers(1, &framebuffer); 86 glDeleteFramebuffers(1, &framebuffer);
87 } 87 }
88 88
89 #endif // defined(OS_MACOSX) 89 #endif // defined(OS_MACOSX)
90 90
91 } // namespace gpu 91 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698