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

Unified Diff: gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc

Issue 2802613003: GpuMemoryBufferFactoryOzoneNativePixmap: expose supported GMB attribs
Patch Set: rename GetSupportedGpuMemoryBufferAttribsForUsage to GetGpuMemoryBufferAttribsForUsage Created 3 years, 8 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
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
index cc08eb86e4138313138022a66430604fce455a76..83cf260b00d3e48e6a563d2224798e92789a95f7 100644
--- a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
+++ b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
@@ -67,6 +67,23 @@ void GpuMemoryBufferFactoryNativePixmap::DestroyGpuMemoryBuffer(
native_pixmaps_.erase(key);
}
+gfx::GpuMemoryBufferAttribVector GpuMemoryBufferFactoryNativePixmap::
+ GetGpuMemoryBufferAttribsForUsage(gfx::BufferUsage usage) {
+ switch (usage) {
+ case gfx::BufferUsage::SCANOUT:
+ case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
+ return ui::OzonePlatform::GetInstance()
+ ->GetSurfaceFactoryOzone()
+ ->GetScanoutFormatsWithModifiers(gfx::kNullAcceleratedWidget);
+ case gfx::BufferUsage::GPU_READ:
+ case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
+ case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
+ return gl::GLImageNativePixmap::QueryDmaBufFormatsAndModifiers();
+ default:
+ return gfx::GpuMemoryBufferAttribVector();
+ }
+}
+
ImageFactory* GpuMemoryBufferFactoryNativePixmap::AsImageFactory() {
return this;
}
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698