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