| Index: cc/resources/resource_provider.cc
|
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
|
| index e7d309db8a964fa061bd76ef29ba3d21fcd78886..9d06c6d7449e910f454999d83b488e20787b1a22 100644
|
| --- a/cc/resources/resource_provider.cc
|
| +++ b/cc/resources/resource_provider.cc
|
| @@ -486,7 +486,7 @@ ResourceProvider::~ResourceProvider() {
|
| gl->Finish();
|
| }
|
|
|
| -bool ResourceProvider::IsResourceFormatSupported(ResourceFormat format) const {
|
| +bool ResourceProvider::IsTextureFormatSupported(ResourceFormat format) const {
|
| gpu::Capabilities caps;
|
| if (compositor_context_provider_)
|
| caps = compositor_context_provider_->ContextCapabilities();
|
| @@ -505,13 +505,41 @@ bool ResourceProvider::IsResourceFormatSupported(ResourceFormat format) const {
|
| case RED_8:
|
| return caps.texture_rg;
|
| case LUMINANCE_F16:
|
| + case RGBA_F16:
|
| return caps.texture_half_float_linear;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return false;
|
| +}
|
| +
|
| +bool ResourceProvider::IsRenderBufferFormatSupported(
|
| + ResourceFormat format) const {
|
| + gpu::Capabilities caps;
|
| + if (compositor_context_provider_)
|
| + caps = compositor_context_provider_->ContextCapabilities();
|
| +
|
| + switch (format) {
|
| + case RGBA_4444:
|
| + case RGBA_8888:
|
| + case RGB_565:
|
| + return true;
|
| + case BGRA_8888:
|
| + return caps.render_buffer_format_bgra8888;
|
| case RGBA_F16:
|
| // TODO(ccameron): This will always return false on pixel tests, which
|
| // makes it un-test-able until we upgrade Mesa.
|
| // https://crbug.com/687720
|
| return caps.texture_half_float_linear &&
|
| caps.color_buffer_half_float_rgba;
|
| + case LUMINANCE_8:
|
| + case ALPHA_8:
|
| + case RED_8:
|
| + case ETC1:
|
| + case LUMINANCE_F16:
|
| + // We don't currently render into these formats. If we need to render into
|
| + // these eventually, we should expand this logic.
|
| + return false;
|
| }
|
|
|
| NOTREACHED();
|
|
|