Index: cc/resources/resource_provider.cc |
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc |
index 19b9e926cc093a11eaf30208bdbfbb7bb09c0e50..864a03f2e1de91873d4800e574be1365491a4e43 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; |
@@ -445,6 +447,12 @@ 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 |
+ // measurement. |
+ // Uncomment following lines to use F16 for Y16. |
+ // y16_resource_format_ = caps.texture_half_float_linear ? LUMINANCE_F16 : |
+ // LUMINANCE_8; |
Ken Russell (switch to Gerrit)
2016/08/16 00:22:26
Does this really use a luminance texture containin
aleksandar.stojiljkovic
2016/08/16 12:02:31
It doesn't. I just reused YUV path for the prototy
aleksandar.stojiljkovic
2016/09/20 12:22:54
If software planes (shared memory) are used, the c
|
yuv_highbit_resource_format_ = yuv_resource_format_; |
if (caps.texture_half_float_linear) |
yuv_highbit_resource_format_ = LUMINANCE_F16; |
@@ -516,6 +524,8 @@ bool ResourceProvider::IsResourceFormatSupported(ResourceFormat format) const { |
return caps.texture_rg; |
case LUMINANCE_F16: |
return caps.texture_half_float_linear; |
+ case RG_88: |
+ return caps.texture_rg; |
} |
NOTREACHED(); |
@@ -547,6 +557,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) { |