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

Side by Side Diff: gpu/command_buffer/tests/gl_gpu_memory_buffer_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 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/gl2chromium.h> 6 #include <GLES2/gl2chromium.h>
7 #include <GLES2/gl2ext.h> 7 #include <GLES2/gl2ext.h>
8 #include <GLES2/gl2extchromium.h> 8 #include <GLES2/gl2extchromium.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 buffer->Unmap(); 204 buffer->Unmap();
205 205
206 // Create the image. This should add the image ID to the ImageManager. 206 // Create the image. This should add the image ID to the ImageManager.
207 GLuint image_id = 207 GLuint image_id =
208 glCreateImageCHROMIUM(buffer->AsClientBuffer(), kImageWidth, kImageHeight, 208 glCreateImageCHROMIUM(buffer->AsClientBuffer(), kImageWidth, kImageHeight,
209 InternalFormat(GetParam())); 209 InternalFormat(GetParam()));
210 ASSERT_NE(0u, image_id); 210 ASSERT_NE(0u, image_id);
211 ASSERT_TRUE(gl_.decoder()->GetImageManager()->LookupImage(image_id) != NULL); 211 ASSERT_TRUE(gl_.decoder()->GetImageManager()->LookupImage(image_id) != NULL);
212 212
213 // Bind the image. 213 // Bind the image.
214 glBindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id); 214 glBindTexImage2DCHROMIUM(GL_TEXTURE_2D, image_id, 0);
215 215
216 // Build program, buffers and draw the texture. 216 // Build program, buffers and draw the texture.
217 GLuint vertex_shader = 217 GLuint vertex_shader =
218 GLTestHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader); 218 GLTestHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader);
219 GLuint fragment_shader = 219 GLuint fragment_shader =
220 GLTestHelper::LoadShader(GL_FRAGMENT_SHADER, kFragmentShader); 220 GLTestHelper::LoadShader(GL_FRAGMENT_SHADER, kFragmentShader);
221 GLuint program = GLTestHelper::SetupProgram(vertex_shader, fragment_shader); 221 GLuint program = GLTestHelper::SetupProgram(vertex_shader, fragment_shader);
222 ASSERT_NE(0u, program); 222 ASSERT_NE(0u, program);
223 glUseProgram(program); 223 glUseProgram(program);
224 224
(...skipping 27 matching lines...) Expand all
252 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests, 252 INSTANTIATE_TEST_CASE_P(GpuMemoryBufferTests,
253 GpuMemoryBufferTest, 253 GpuMemoryBufferTest,
254 ::testing::Values(gfx::BufferFormat::R_8, 254 ::testing::Values(gfx::BufferFormat::R_8,
255 gfx::BufferFormat::BGR_565, 255 gfx::BufferFormat::BGR_565,
256 gfx::BufferFormat::RGBA_4444, 256 gfx::BufferFormat::RGBA_4444,
257 gfx::BufferFormat::RGBA_8888, 257 gfx::BufferFormat::RGBA_8888,
258 gfx::BufferFormat::BGRA_8888)); 258 gfx::BufferFormat::BGRA_8888));
259 259
260 } // namespace gles2 260 } // namespace gles2
261 } // namespace gpu 261 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc ('k') | gpu/command_buffer/tests/texture_image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698