Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2235)

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 962723002: Change CHROMIUM_image declarations to support multi planar input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle through IPC. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698