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

Unified Diff: cc/resources/resource_provider.cc

Issue 2969223002: [media]: Replace LUMINANCE_F16 by R16 for 9/10-bit h264 videos.
Patch Set: Fix in resource_format_utils Created 3 years, 4 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 fc86a436df84065a8edf53b3139cb8bb8c79da63..391f1f40acc677f967b28b0e4d153d513db92c17 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -32,6 +32,7 @@
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+#include "media/base/media_switches.h"
#include "skia/ext/texture_handle.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
@@ -106,6 +107,7 @@ GLenum TextureToStorageFormat(viz::ResourceFormat format) {
case viz::ETC1:
case viz::RED_8:
case viz::LUMINANCE_F16:
+ case viz::R16_EXT:
NOTREACHED();
break;
}
@@ -127,6 +129,7 @@ bool IsFormatSupportedForStorage(viz::ResourceFormat format, bool use_bgra) {
case viz::ETC1:
case viz::RED_8:
case viz::LUMINANCE_F16:
+ case viz::R16_EXT:
return false;
}
return false;
@@ -354,9 +357,12 @@ ResourceProvider::Settings::Settings(
yuv_resource_format = yuv_highbit_resource_format = viz::RGBA_8888;
} else {
yuv_resource_format = caps.texture_rg ? viz::RED_8 : viz::LUMINANCE_8;
- yuv_highbit_resource_format = caps.texture_half_float_linear
- ? viz::LUMINANCE_F16
- : yuv_resource_format;
+ yuv_highbit_resource_format =
+ (base::FeatureList::IsEnabled(media::kUseR16Texture) &&
+ caps.texture_norm16)
+ ? viz::R16_EXT
+ : (caps.texture_half_float_linear ? viz::LUMINANCE_F16
+ : yuv_resource_format);
}
GLES2Interface* gl = compositor_context_provider->ContextGL();
@@ -458,6 +464,8 @@ bool ResourceProvider::IsTextureFormatSupported(
return caps.texture_format_etc1;
case viz::RED_8:
return caps.texture_rg;
+ case viz::R16_EXT:
+ return caps.texture_norm16;
case viz::LUMINANCE_F16:
case viz::RGBA_F16:
return caps.texture_half_float_linear;
@@ -491,6 +499,7 @@ bool ResourceProvider::IsRenderBufferFormatSupported(
case viz::RED_8:
case viz::ETC1:
case viz::LUMINANCE_F16:
+ case viz::R16_EXT:
// We don't currently render into these formats. If we need to render into
// these eventually, we should expand this logic.
return false;
« 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