| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |