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

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: bilinear filter for rg88, float and half float added. Created 4 years, 5 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..33ff5a30e373e90abb390857b48497b20b8dde1c 100644
--- a/cc/resources/resource_format.cc
+++ b/cc/resources/resource_format.cc
@@ -13,9 +13,11 @@ int BitsPerPixel(ResourceFormat format) {
switch (format) {
case BGRA_8888:
case RGBA_8888:
+ case LUMINANCE_F32:
return 32;
case RGBA_4444:
case RGB_565:
+ case RG_88:
case LUMINANCE_F16:
return 16;
case ALPHA_8:
@@ -41,6 +43,8 @@ GLenum GLDataType(ResourceFormat format) {
GL_UNSIGNED_BYTE, // ETC1
GL_UNSIGNED_BYTE, // RED_8
GL_HALF_FLOAT_OES, // LUMINANCE_F16
+ GL_FLOAT, // LUMINANCE_F32
+ 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.");
@@ -60,6 +64,8 @@ GLenum GLDataFormat(ResourceFormat format) {
GL_ETC1_RGB8_OES, // ETC1
GL_RED_EXT, // RED_8
GL_LUMINANCE, // LUMINANCE_F16
+ GL_LUMINANCE, // LUMINANCE_F32
+ 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.");
@@ -90,6 +96,8 @@ GLenum GLCopyTextureInternalFormat(ResourceFormat format) {
GL_RGB, // ETC1
GL_LUMINANCE, // RED_8
GL_LUMINANCE, // LUMINANCE_F16
+ GL_LUMINANCE, // LUMINANCE_F32
+ 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.");
@@ -112,6 +120,8 @@ gfx::BufferFormat BufferFormat(ResourceFormat format) {
case LUMINANCE_8:
case RGB_565:
case LUMINANCE_F16:
+ case LUMINANCE_F32:
+ case RG_88:
break;
}
NOTREACHED();
@@ -134,6 +144,8 @@ bool DoesResourceFormatSupportAlpha(ResourceFormat format) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case LUMINANCE_F32:
+ case RG_88:
return false;
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698