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

Unified Diff: cc/resources/resource_format.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: cc/resources/resource_format.cc
diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc
index 9a47c7e380df9ccd09ad6a31542f4480a9c9b095..3dcc5d6fff2bffca9625272561480c22668e598b 100644
--- a/cc/resources/resource_format.cc
+++ b/cc/resources/resource_format.cc
@@ -17,6 +17,7 @@ int BitsPerPixel(ResourceFormat format) {
case RGBA_4444:
case RGB_565:
case LUMINANCE_F16:
+ case RG_88:
return 16;
case ALPHA_8:
case LUMINANCE_8:
@@ -41,6 +42,7 @@ GLenum GLDataType(ResourceFormat format) {
GL_UNSIGNED_BYTE, // ETC1
GL_UNSIGNED_BYTE, // RED_8
GL_HALF_FLOAT_OES, // LUMINANCE_F16
+ GL_UNSIGNED_BYTE, // RG_88
};
static_assert(arraysize(format_gl_data_type) == (RESOURCE_FORMAT_MAX + 1),
"format_gl_data_type does not handle all cases.");
@@ -58,8 +60,9 @@ GLenum GLDataFormat(ResourceFormat format) {
GL_LUMINANCE, // LUMINANCE_8
GL_RGB, // RGB_565
GL_ETC1_RGB8_OES, // ETC1
- GL_RED_EXT, // RED_8
+ GL_R8_EXT, // RED_8
GL_LUMINANCE, // LUMINANCE_F16
+ GL_RG_EXT, // RG_88
};
static_assert(arraysize(format_gl_data_format) == (RESOURCE_FORMAT_MAX + 1),
"format_gl_data_format does not handle all cases.");
@@ -88,8 +91,9 @@ GLenum GLCopyTextureInternalFormat(ResourceFormat format) {
GL_LUMINANCE, // LUMINANCE_8
GL_RGB, // RGB_565
GL_RGB, // ETC1
- GL_LUMINANCE, // RED_8
+ GL_R8_EXT, // RED_8
GL_LUMINANCE, // LUMINANCE_F16
+ GL_RG8_EXT, // RG_88
};
static_assert(arraysize(format_gl_data_format) == (RESOURCE_FORMAT_MAX + 1),
"format_gl_data_format does not handle all cases.");
@@ -102,6 +106,8 @@ gfx::BufferFormat BufferFormat(ResourceFormat format) {
return gfx::BufferFormat::BGRA_8888;
case RED_8:
return gfx::BufferFormat::R_8;
+ case RG_88:
+ return gfx::BufferFormat::RG_88;
case RGBA_4444:
return gfx::BufferFormat::RGBA_4444;
case RGBA_8888:
@@ -134,6 +140,7 @@ bool DoesResourceFormatSupportAlpha(ResourceFormat format) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case RG_88:
return false;
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698