| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/buffer.h" | 5 #include "components/exo/buffer.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 GL_RGB, // BGR_565 | 50 GL_RGB, // BGR_565 |
| 51 GL_RGBA, // RGBA_4444 | 51 GL_RGBA, // RGBA_4444 |
| 52 GL_RGB, // RGBX_8888 | 52 GL_RGB, // RGBX_8888 |
| 53 GL_RGBA, // RGBA_8888 | 53 GL_RGBA, // RGBA_8888 |
| 54 GL_RGB, // BGRX_8888 | 54 GL_RGB, // BGRX_8888 |
| 55 GL_BGRA_EXT, // BGRA_8888 | 55 GL_BGRA_EXT, // BGRA_8888 |
| 56 GL_RGBA, // RGBA_F16 | 56 GL_RGBA, // RGBA_F16 |
| 57 GL_RGB_YCRCB_420_CHROMIUM, // YVU_420 | 57 GL_RGB_YCRCB_420_CHROMIUM, // YVU_420 |
| 58 GL_RGB_YCBCR_420V_CHROMIUM, // YUV_420_BIPLANAR | 58 GL_RGB_YCBCR_420V_CHROMIUM, // YUV_420_BIPLANAR |
| 59 GL_RGB_YCBCR_422_CHROMIUM, // UYVY_422 | 59 GL_RGB_YCBCR_422_CHROMIUM, // UYVY_422 |
| 60 GL_RGB_YCBCR_422_CHROMIUM, // YUYV_422 |
| 60 }; | 61 }; |
| 61 static_assert(arraysize(kGLInternalFormats) == | 62 static_assert(arraysize(kGLInternalFormats) == |
| 62 (static_cast<int>(gfx::BufferFormat::LAST) + 1), | 63 (static_cast<int>(gfx::BufferFormat::LAST) + 1), |
| 63 "BufferFormat::LAST must be last value of kGLInternalFormats"); | 64 "BufferFormat::LAST must be last value of kGLInternalFormats"); |
| 64 | 65 |
| 65 DCHECK(format <= gfx::BufferFormat::LAST); | 66 DCHECK(format <= gfx::BufferFormat::LAST); |
| 66 return kGLInternalFormats[static_cast<int>(format)]; | 67 return kGLInternalFormats[static_cast<int>(format)]; |
| 67 } | 68 } |
| 68 | 69 |
| 69 unsigned CreateGLTexture(gpu::gles2::GLES2Interface* gles2, GLenum target) { | 70 unsigned CreateGLTexture(gpu::gles2::GLES2Interface* gles2, GLenum target) { |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 556 |
| 556 // Cancel callback to indicate that buffer has been released. | 557 // Cancel callback to indicate that buffer has been released. |
| 557 release_contents_callback_.Cancel(); | 558 release_contents_callback_.Cancel(); |
| 558 | 559 |
| 559 // Release buffer if not attached to surface. | 560 // Release buffer if not attached to surface. |
| 560 if (!attach_count_) | 561 if (!attach_count_) |
| 561 Release(); | 562 Release(); |
| 562 } | 563 } |
| 563 | 564 |
| 564 } // namespace exo | 565 } // namespace exo |
| OLD | NEW |