| 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 87f0d051939571a904aafb859d5034271ea25b85..c108a999454b15af174e6adb857fc7c1e2fe48e5 100644
|
| --- a/content/common/gpu/gpu_command_buffer_stub.cc
|
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc
|
| @@ -140,6 +140,29 @@ DevToolsChannelData::CreateForChannel(GpuChannel* channel) {
|
| return new DevToolsChannelData(res.release());
|
| }
|
|
|
| +bool IsSupportedImageFormat(const gpu::Capabilities& capabilities,
|
| + gfx::GpuMemoryBuffer::Format format) {
|
| + switch (format) {
|
| + case gfx::GpuMemoryBuffer::ATC:
|
| + case gfx::GpuMemoryBuffer::ATCIA:
|
| + return capabilities.texture_format_atc;
|
| + case gfx::GpuMemoryBuffer::BGRA_8888:
|
| + return capabilities.texture_format_bgra8888;
|
| + case gfx::GpuMemoryBuffer::DXT1:
|
| + return capabilities.texture_format_dxt1;
|
| + case gfx::GpuMemoryBuffer::DXT5:
|
| + return capabilities.texture_format_dxt5;
|
| + case gfx::GpuMemoryBuffer::ETC1:
|
| + return capabilities.texture_format_etc1;
|
| + case gfx::GpuMemoryBuffer::RGBA_8888:
|
| + case gfx::GpuMemoryBuffer::RGBX_8888:
|
| + return true;
|
| + }
|
| +
|
| + NOTREACHED();
|
| + return false;
|
| +}
|
| +
|
| } // namespace
|
|
|
| GpuCommandBufferStub::GpuCommandBufferStub(
|
| @@ -956,6 +979,11 @@ void GpuCommandBufferStub::OnCreateImage(int32 id,
|
| return;
|
| }
|
|
|
| + if (!IsSupportedImageFormat(decoder_->GetCapabilities(), format)) {
|
| + LOG(ERROR) << "Image format is not supported.";
|
| + return;
|
| + }
|
| +
|
| scoped_refptr<gfx::GLImage> image = channel()->CreateImageForGpuMemoryBuffer(
|
| handle, size, format, internalformat);
|
| if (!image.get())
|
|
|