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

Side by Side Diff: components/exo/buffer.cc

Issue 2648633005: cros: Support YUYV format for GPU memory buffer video frames
Patch Set: Created 3 years, 11 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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 GL_RG8_EXT, // RG_88 49 GL_RG8_EXT, // RG_88
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_RGB_YCRCB_420_CHROMIUM, // YVU_420 56 GL_RGB_YCRCB_420_CHROMIUM, // YVU_420
57 GL_RGB_YCBCR_420V_CHROMIUM, // YUV_420_BIPLANAR 57 GL_RGB_YCBCR_420V_CHROMIUM, // YUV_420_BIPLANAR
58 GL_RGB_YCBCR_422_CHROMIUM, // UYVY_422 58 GL_RGB_YCBCR_422_CHROMIUM, // UYVY_422
59 GL_RGB_YCBCR_422_CHROMIUM, // YUYV_422
59 }; 60 };
60 static_assert(arraysize(kGLInternalFormats) == 61 static_assert(arraysize(kGLInternalFormats) ==
61 (static_cast<int>(gfx::BufferFormat::LAST) + 1), 62 (static_cast<int>(gfx::BufferFormat::LAST) + 1),
62 "BufferFormat::LAST must be last value of kGLInternalFormats"); 63 "BufferFormat::LAST must be last value of kGLInternalFormats");
63 64
64 DCHECK(format <= gfx::BufferFormat::LAST); 65 DCHECK(format <= gfx::BufferFormat::LAST);
65 return kGLInternalFormats[static_cast<int>(format)]; 66 return kGLInternalFormats[static_cast<int>(format)];
66 } 67 }
67 68
68 unsigned CreateGLTexture(gpu::gles2::GLES2Interface* gles2, GLenum target) { 69 unsigned CreateGLTexture(gpu::gles2::GLES2Interface* gles2, GLenum target) {
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 texture_ = std::move(texture); 561 texture_ = std::move(texture);
561 } 562 }
562 563
563 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) { 564 void Buffer::ReleaseContentsTexture(std::unique_ptr<Texture> texture) {
564 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture"); 565 TRACE_EVENT0("exo", "Buffer::ReleaseContentsTexture");
565 contents_texture_ = std::move(texture); 566 contents_texture_ = std::move(texture);
566 Release(); 567 Release();
567 } 568 }
568 569
569 } // namespace exo 570 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698