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

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: rebase Created 4 years, 2 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
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/video_resource_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 42eda06e3e5863520b709e78d1df3256e52dc008..d75afe5938456ab1240ceb545f0ff1002a2fb0f4 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -93,6 +93,7 @@ GLenum TextureToStorageFormat(ResourceFormat format) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case RG_88:
NOTREACHED();
break;
}
@@ -113,6 +114,7 @@ bool IsFormatSupportedForStorage(ResourceFormat format, bool use_bgra) {
case ETC1:
case RED_8:
case LUMINANCE_F16:
+ case RG_88:
return false;
}
return false;
@@ -458,6 +460,9 @@ ResourceProvider::ResourceProvider(
caps.texture_half_float_linear ? LUMINANCE_F16 : yuv_resource_format_;
}
+ y16_resource_format_ =
+ (!caps.disable_one_component_textures && caps.texture_rg) ? RG_88
+ : RGBA_8888;
use_sync_query_ = caps.sync_query;
GLES2Interface* gl = ContextGL();
@@ -523,6 +528,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;
@@ -586,6 +592,10 @@ ResourceId ResourceProvider::CreateResource(
return 0;
}
+ResourceFormat ResourceProvider::Y16ResourceFormat() const {
+ return y16_resource_format_;
+}
+
ResourceId ResourceProvider::CreateGpuMemoryBufferResource(
const gfx::Size& size,
TextureHint hint,
@@ -1068,6 +1078,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;
}
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/video_resource_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698