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

Unified Diff: ui/ozone/gl/gl_image_ozone_native_pixmap.cc

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/gl/gl_image_ozone_native_pixmap.cc
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
index 39f23a0bed64969c1ad356b3d42ffc988515143f..9dfc484a6d3391060272430ceb2af480d0297b63 100644
--- a/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
+++ b/ui/ozone/gl/gl_image_ozone_native_pixmap.cc
@@ -14,6 +14,7 @@
(static_cast<uint32_t>(c) << 16) | (static_cast<uint32_t>(d) << 24))
#define DRM_FORMAT_R8 FOURCC('R', '8', ' ', ' ')
+#define DRM_FORMAT_GR88 FOURCC('G', 'R', '8', '8')
#define DRM_FORMAT_RGB565 FOURCC('R', 'G', '1', '6')
#define DRM_FORMAT_ARGB8888 FOURCC('A', 'R', '2', '4')
#define DRM_FORMAT_ABGR8888 FOURCC('A', 'B', '2', '4')
@@ -38,6 +39,8 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) {
return format == gfx::BufferFormat::BGRA_8888;
case GL_RED_EXT:
return format == gfx::BufferFormat::R_8;
+ case GL_RG_EXT:
+ return format == gfx::BufferFormat::RG_88;
default:
return false;
}
@@ -46,6 +49,7 @@ bool ValidInternalFormat(unsigned internalformat, gfx::BufferFormat format) {
bool ValidFormat(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
+ case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::RGBX_8888:
@@ -72,6 +76,8 @@ EGLint FourCC(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
return DRM_FORMAT_R8;
+ case gfx::BufferFormat::RG_88:
+ return DRM_FORMAT_GR88;
case gfx::BufferFormat::BGR_565:
return DRM_FORMAT_RGB565;
case gfx::BufferFormat::RGBA_8888:
@@ -239,6 +245,8 @@ unsigned GLImageOzoneNativePixmap::GetInternalFormatForTesting(
switch (format) {
case gfx::BufferFormat::R_8:
return GL_RED_EXT;
+ case gfx::BufferFormat::RG_88:
+ return GL_RG_EXT;
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::BGRX_8888:

Powered by Google App Engine
This is Rietveld 408576698