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

Unified Diff: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.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: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
index 91ce24e7c397572874a1109436e29acb9ed49f9b..111cf317ed3f2c47b0ed985905be6e83ce48b995 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
@@ -419,6 +419,21 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTexture(
(source_internal_format == dest_internal_format &&
source_internal_format != GL_BGRA_EXT) ||
(source_internal_format == GL_RGBA && dest_internal_format == GL_RGB);
+ if (!source_format_contain_superset_of_dest_format) {
+ using GL = gles2::GLES2Util;
+ uint32_t source_channels = GL::GetChannelsForFormat(source_internal_format);
+ uint32_t dest_channels = GL::GetChannelsForFormat(dest_internal_format);
+ const gles2::FeatureInfo* info = decoder->GetFeatureInfo();
+ source_format_contain_superset_of_dest_format =
+ (GL::IsIntegerFormat(dest_internal_format) ==
+ GL::IsIntegerFormat(source_internal_format)) &&
+ (source_channels == dest_channels) &&
+ (((dest_channels == GL::kRed || dest_channels == GL::kAlpha ||
+ dest_channels == (GL::kRed | GL::kGreen)) &&
+ info->IsES3Capable()) ||
+ (dest_channels == GL::kRed && info->feature_flags().ext_texture_rg &&
+ !GL::IsIntegerFormat(dest_internal_format)));
Ken Russell (switch to Gerrit) 2016/09/30 23:01:29 This addition to the code is very highly specializ
aleksandar.stojiljkovic 2016/10/03 10:56:52 Done. This would be useful later - edited out from
+ }
// GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2,
// so restrict this to GL_TEXTURE_2D.
if (source_target == GL_TEXTURE_2D && dest_target == GL_TEXTURE_2D &&

Powered by Google App Engine
This is Rietveld 408576698