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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.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: reveman@ comments. Created 5 years, 9 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_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index 6185150e5cf71764ea4ffcef46548084ae8253e3..7ffa3af0997753bc889efca3122f3dd242d24678 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -79,13 +79,26 @@ gpu::ImageFactory* GpuMemoryBufferFactoryOzoneNativeBuffer::AsImageFactory() {
}
scoped_refptr<gfx::GLImage>
-GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
+GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffers(
+ const std::vector<gfx::GpuMemoryBufferHandle>& handles,
const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format,
+ const std::vector<gfx::GpuMemoryBuffer::Format>& formats,
unsigned internalformat,
int client_id) {
+ // TODO(emircan): See http://crbug.com/439520; support passing multiple
+ // buffers when new multi-planar formats are added.
+ size_t num_buffers =
+ gpu::ImageFactory::NumberOfPlanesForImageFormat(internalformat);
+ if (num_buffers != 1) {
+ NOTIMPLEMENTED();
+ return scoped_refptr<gfx::GLImage>();
+ }
+
+ const gfx::GpuMemoryBufferHandle& handle = handles[0];
+ const gfx::GpuMemoryBuffer::Format format = formats[0];
+
DCHECK_EQ(handle.type, gfx::OZONE_NATIVE_BUFFER);
+
return ozone_native_buffer_factory_.CreateImageForGpuMemoryBuffer(
handle.id, size, format, internalformat, client_id);
}

Powered by Google App Engine
This is Rietveld 408576698