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

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

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void TearDown() override { 59 void TearDown() override {
60 glDeleteTextures(2, textures_); 60 glDeleteTextures(2, textures_);
61 glDeleteFramebuffers(1, &framebuffer_id_); 61 glDeleteFramebuffers(1, &framebuffer_id_);
62 gl_.Destroy(); 62 gl_.Destroy();
63 } 63 }
64 64
65 void CreateBackingForTexture(GLenum target, GLsizei width, GLsizei height) { 65 void CreateBackingForTexture(GLenum target, GLsizei width, GLsizei height) {
66 if (target == GL_TEXTURE_RECTANGLE_ARB) { 66 if (target == GL_TEXTURE_RECTANGLE_ARB) {
67 GLuint image_id = glCreateGpuMemoryBufferImageCHROMIUM( 67 GLuint image_id = glCreateGpuMemoryBufferImageCHROMIUM(
68 width, height, GL_RGBA, GL_READ_WRITE_CHROMIUM); 68 width, height, GL_RGBA, GL_READ_WRITE_CHROMIUM);
69 glBindTexImage2DCHROMIUM(target, image_id); 69 glBindTexImage2DCHROMIUM(target, image_id, 0);
70 } else { 70 } else {
71 glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA, 71 glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA,
72 GL_UNSIGNED_BYTE, nullptr); 72 GL_UNSIGNED_BYTE, nullptr);
73 } 73 }
74 } 74 }
75 75
76 GLenum ExtractFormatFrom(GLenum internalformat) { 76 GLenum ExtractFormatFrom(GLenum internalformat) {
77 switch (internalformat) { 77 switch (internalformat) {
78 case GL_RGBA8_OES: 78 case GL_RGBA8_OES:
79 return GL_RGBA; 79 return GL_RGBA;
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 expected_color = y < copy_region_y + 1 ? blue : white; 894 expected_color = y < copy_region_y + 1 ? blue : white;
895 } 895 }
896 GLTestHelper::CheckPixels(x, y, 1, 1, 0, expected_color); 896 GLTestHelper::CheckPixels(x, y, 1, 1, 0, expected_color);
897 } 897 }
898 } 898 }
899 } 899 }
900 } 900 }
901 } 901 }
902 902
903 } // namespace gpu 903 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager_unittest.cc ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698