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

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

Issue 2648893002: Remove remaining traces of CreateGpuMemoryBufferImageCHROMIUM (Closed)
Patch Set: Rebase, but don't pull in extra changes... Created 3 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
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 gl_.Initialize(options); 293 gl_.Initialize(options);
294 294
295 width_ = 8; 295 width_ = 8;
296 height_ = 8; 296 height_ = 8;
297 } 297 }
298 298
299 void TearDown() override { gl_.Destroy(); } 299 void TearDown() override { gl_.Destroy(); }
300 300
301 void CreateBackingForTexture(GLenum target, GLsizei width, GLsizei height) { 301 void CreateBackingForTexture(GLenum target, GLsizei width, GLsizei height) {
302 if (target == GL_TEXTURE_RECTANGLE_ARB) { 302 if (target == GL_TEXTURE_RECTANGLE_ARB) {
303 GLuint image_id = glCreateGpuMemoryBufferImageCHROMIUM( 303 std::unique_ptr<gfx::GpuMemoryBuffer> buffer(gl_.CreateGpuMemoryBuffer(
304 width, height, GL_RGBA, GL_READ_WRITE_CHROMIUM); 304 gfx::Size(width, height), gfx::BufferFormat::RGBA_8888));
305 GLuint image_id = glCreateImageCHROMIUM(buffer->AsClientBuffer(), width,
306 height, GL_RGBA);
305 glBindTexImage2DCHROMIUM(target, image_id); 307 glBindTexImage2DCHROMIUM(target, image_id);
306 } else { 308 } else {
307 glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA, 309 glTexImage2D(target, 0, GL_RGBA, width, height, 0, GL_RGBA,
308 GL_UNSIGNED_BYTE, nullptr); 310 GL_UNSIGNED_BYTE, nullptr);
309 } 311 }
310 } 312 }
311 313
312 GLuint CreateDrawingTexture(GLenum target, GLsizei width, GLsizei height) { 314 GLuint CreateDrawingTexture(GLenum target, GLsizei width, GLsizei height) {
313 GLuint texture = 0; 315 GLuint texture = 0;
314 glGenTextures(1, &texture); 316 glGenTextures(1, &texture);
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 } 1586 }
1585 } 1587 }
1586 1588
1587 glDeleteTextures(2, textures_); 1589 glDeleteTextures(2, textures_);
1588 glDeleteFramebuffers(1, &framebuffer_id_); 1590 glDeleteFramebuffers(1, &framebuffer_id_);
1589 } 1591 }
1590 } 1592 }
1591 } 1593 }
1592 1594
1593 } // namespace gpu 1595 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698