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

Unified Diff: ui/ozone/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: ImageFactory::CreateImageForGpuMemoryBuffer interface changes. 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: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index 8d6d8142f625618a42b86d447ecd843bb6ef4159..bc81a9995d573f2fc5c696080dff27a23be3ff16 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -151,22 +151,29 @@ void GpuMemoryBufferFactoryOzoneNativeBuffer::DestroyGpuMemoryBuffer(
scoped_refptr<gfx::GLImage>
GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer(
- gfx::GpuMemoryBufferId id,
+ const std::vector<gfx::GpuMemoryBufferId>& ids,
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.
+ if ((ids.size() != 1) || (formats.size() != 1)) {
+ NOTIMPLEMENTED();
+ return scoped_refptr<gfx::GLImage>();
+ }
+
NativePixmap* pixmap = nullptr;
{
base::AutoLock lock(native_pixmap_map_lock_);
BufferToPixmapMap::iterator it =
- native_pixmap_map_.find(GetIndex(id, client_id));
+ native_pixmap_map_.find(GetIndex(ids[0], client_id));
if (it == native_pixmap_map_.end()) {
return scoped_refptr<gfx::GLImage>();
}
pixmap = it->second.get();
}
- return CreateImageForPixmap(pixmap, size, format, internalformat);
+ return CreateImageForPixmap(pixmap, size, formats[0], internalformat);
}
scoped_refptr<gfx::GLImage>

Powered by Google App Engine
This is Rietveld 408576698