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; |
} |