Index: cc/resources/resource_provider.cc |
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc |
index 19b9e926cc093a11eaf30208bdbfbb7bb09c0e50..b8eb4edaa723cc6059131e136bb04f6944468c63 100644 |
--- a/cc/resources/resource_provider.cc |
+++ b/cc/resources/resource_provider.cc |
@@ -91,6 +91,8 @@ GLenum TextureToStorageFormat(ResourceFormat format) { |
case ETC1: |
case RED_8: |
case LUMINANCE_F16: |
+ case LUMINANCE_F32: |
+ case RG_88: |
NOTREACHED(); |
break; |
} |
@@ -111,6 +113,8 @@ bool IsFormatSupportedForStorage(ResourceFormat format, bool use_bgra) { |
case ETC1: |
case RED_8: |
case LUMINANCE_F16: |
+ case LUMINANCE_F32: |
+ case RG_88: |
return false; |
} |
return false; |
@@ -445,6 +449,14 @@ 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; |
+ // TODO(astojilj): Temporary code for performance and power consumption |
aleksandar.stojiljkovic
2016/07/15 12:29:06
Uncomment line bellow to measure F16 and F32.
|
+ // measurement. |
+ // Uncomment one of following lines to use F32 or F16 for Y16. |
+ // y16_resource_format_ = caps.texture_half_float_linear ? LUMINANCE_F32 : |
+ // LUMINANCE_8; |
+ // y16_resource_format_ = caps.texture_half_float_linear ? LUMINANCE_F16 : |
+ // LUMINANCE_8; |
yuv_highbit_resource_format_ = yuv_resource_format_; |
if (caps.texture_half_float_linear) |
yuv_highbit_resource_format_ = LUMINANCE_F16; |
@@ -547,6 +559,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) { |