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

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: 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_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index c2e850bc2493872d771842c1db5f628a9ae78d88..8beccf7f250fc9fc419fcd724549afe0feedc36e 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;
@@ -446,6 +448,10 @@ 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
+ : RGBA_8888;
yuv_highbit_resource_format_ = yuv_resource_format_;
if (caps.texture_half_float_linear)
yuv_highbit_resource_format_ = LUMINANCE_F16;
@@ -514,6 +520,7 @@ bool ResourceProvider::IsResourceFormatSupported(ResourceFormat format) const {
case ETC1:
return caps.texture_format_etc1;
case RED_8:
+ case RG_88:
return caps.texture_rg;
case LUMINANCE_F16:
return caps.texture_half_float_linear;
@@ -577,6 +584,10 @@ ResourceId ResourceProvider::CreateResource(
return 0;
}
+ResourceFormat ResourceProvider::Y16ResourceFormat() const {
+ return y16_resource_format_;
+}
+
ResourceId ResourceProvider::CreateGpuMemoryBufferResource(
const gfx::Size& size,
TextureHint hint,
@@ -1040,6 +1051,7 @@ ResourceProvider::ScopedReadLockGL::ScopedReadLockGL(
const Resource* resource = resource_provider->LockForRead(resource_id);
texture_id_ = resource->gl_id;
target_ = resource->target;
+ format_ = resource->format;
size_ = resource->size;
color_space_ = resource->color_space;
}

Powered by Google App Engine
This is Rietveld 408576698