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

Unified Diff: cc/resources/resource_provider.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: 8 bpp support added. R200 camera supported. 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_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 406aa73b3331aaec3e9a9c8fe16258cb53254c3e..6c94a5fedea0135d2ea962941952ce2764410d6c 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -91,6 +91,7 @@ GLenum TextureToStorageFormat(ResourceFormat format) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case RG_88:
NOTREACHED();
break;
}
@@ -111,6 +112,7 @@ bool IsFormatSupportedForStorage(ResourceFormat format, bool use_bgra) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case RG_88:
return false;
}
return false;
@@ -447,6 +449,7 @@ ResourceProvider::ResourceProvider(
use_texture_usage_hint_ = caps.texture_usage;
use_compressed_texture_etc1_ = caps.texture_format_etc1;
yuv_resource_format_ = caps.texture_rg ? RED_8 : LUMINANCE_8;
+ y16_resource_format_ = caps.texture_rg ? RG_88 : LUMINANCE_8;
yuv_highbit_resource_format_ = yuv_resource_format_;
if (caps.texture_half_float_linear)
yuv_highbit_resource_format_ = LUMINANCE_F16;
@@ -549,6 +552,14 @@ ResourceFormat ResourceProvider::YuvResourceFormat(int bits) const {
}
}
+ResourceFormat ResourceProvider::Y16ResourceFormat(int bits) const {
+ if (bits > 8) {
+ return y16_resource_format_;
+ } else {
+ return yuv_resource_format_;
+ }
+}
+
ResourceId ResourceProvider::CreateResource(const gfx::Size& size,
TextureHint hint,
ResourceFormat format) {

Powered by Google App Engine
This is Rietveld 408576698