Chromium Code Reviews| Index: content/common/gpu/gpu_command_buffer_stub.cc |
| diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
| index 6503c679b07d4ea263806db03e53d4a18038d9b2..e7962a5dafa02202df6f43b598e4c15876792a75 100644 |
| --- a/content/common/gpu/gpu_command_buffer_stub.cc |
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc |
| @@ -956,6 +956,41 @@ void GpuCommandBufferStub::OnCreateImage(int32 id, |
| return; |
| } |
| + bool supported_format = true; |
| + |
| + gpu::Capabilities capabilities = decoder_->GetCapabilities(); |
| + switch (format) { |
| + case gfx::GpuMemoryBuffer::ATC: |
| + case gfx::GpuMemoryBuffer::ATCIA: |
| + if (!capabilities.texture_format_atc) |
| + supported_format = false; |
| + break; |
| + case gfx::GpuMemoryBuffer::BGRA_8888: |
| + if (!capabilities.texture_format_bgra8888) |
| + supported_format = false; |
| + break; |
| + case gfx::GpuMemoryBuffer::DXT1: |
| + if (!capabilities.texture_format_dxt1) |
| + supported_format = false; |
| + break; |
| + case gfx::GpuMemoryBuffer::DXT5: |
| + if (!capabilities.texture_format_dxt5) |
| + supported_format = false; |
| + break; |
| + case gfx::GpuMemoryBuffer::ETC1: |
| + if (!capabilities.texture_format_etc1) |
| + supported_format = false; |
| + break; |
| + case gfx::GpuMemoryBuffer::RGBA_8888: |
| + case gfx::GpuMemoryBuffer::RGBX_8888: |
| + break; |
| + } |
|
reveman
2015/02/13 23:51:25
Looks good. Can you just move this into a IsSuppor
christiank
2015/02/18 14:38:25
Sure! I'll fix this.
|
| + |
| + if (!supported_format) { |
| + LOG(ERROR) << "Image format is not supported."; |
| + return; |
| + } |
| + |
| scoped_refptr<gfx::GLImage> image = channel()->CreateImageForGpuMemoryBuffer( |
| handle, size, format, internalformat); |
| if (!image.get()) |