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 c108a999454b15af174e6adb857fc7c1e2fe48e5..364d1db0ca11e6588943301203c10fb2919d03ba 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -963,9 +963,9 @@ void GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback( |
} |
void GpuCommandBufferStub::OnCreateImage(int32 id, |
- gfx::GpuMemoryBufferHandle handle, |
+ gfx::GpuMemoryBufferHandle* handles, |
reveman
2015/03/04 05:56:00
Receiving pointers over IPC doesn't work.
|
gfx::Size size, |
- gfx::GpuMemoryBuffer::Format format, |
+ gfx::GpuMemoryBuffer::Format* formats, |
reveman
2015/03/04 05:56:00
ditto
|
uint32 internalformat) { |
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateImage"); |
@@ -979,13 +979,20 @@ void GpuCommandBufferStub::OnCreateImage(int32 id, |
return; |
} |
- if (!IsSupportedImageFormat(decoder_->GetCapabilities(), format)) { |
- LOG(ERROR) << "Image format is not supported."; |
- return; |
+ int num_buffers = |
+ gpu::ImageFactory::GpuMemoryBufferCountForImageFormat(internalformat); |
+ |
+ for (int i = 0; i < num_buffers; ++i) { |
+ if (!IsSupportedImageFormat(decoder_->GetCapabilities(), formats[i])) { |
+ LOG(ERROR) << "Image format is not supported."; |
+ return; |
+ } |
} |
+ // TODO(emircan): See http://crbug.com/439520; support passing multiple |
+ // buffers when new multi-planar formats are added. |
scoped_refptr<gfx::GLImage> image = channel()->CreateImageForGpuMemoryBuffer( |
- handle, size, format, internalformat); |
+ handles[0], size, formats[0], internalformat); |
reveman
2015/03/04 05:56:00
Don't stop here :)
emircan
2015/03/04 23:31:50
Went ahead, until the modification of gfx::GLImage
|
if (!image.get()) |
return; |