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

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

Issue 1139903005: Add PERSISTENT_MAP usage for GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: persistentmap: . Created 5 years, 7 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.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory.cc b/content/common/gpu/gpu_memory_buffer_factory.cc
index 019bdd8dbcc629c80ad7ae24fe43d15526feaf77..7794ea64985e31fb3cd454e82276881d73f2f153 100644
--- a/content/common/gpu/gpu_memory_buffer_factory.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory.cc
@@ -23,20 +23,37 @@ namespace content {
// static
void GpuMemoryBufferFactory::GetSupportedTypes(
+ gfx::GpuMemoryBuffer::Usage usage,
std::vector<gfx::GpuMemoryBufferType>* types) {
- const gfx::GpuMemoryBufferType supported_types[] = {
+ switch (usage) {
+ case gfx::GpuMemoryBuffer::PERSISTENT_MAP: {
+ // TODO(reveman): PERSISTENT_MAP is only supported by shared memory
+ // buffers. crbug.com/489438
+ const gfx::GpuMemoryBufferType supported_types[] = {
+ gfx::SHARED_MEMORY_BUFFER};
+ types->assign(supported_types,
+ supported_types + arraysize(supported_types));
+ break;
+ }
+ case gfx::GpuMemoryBuffer::MAP:
+ case gfx::GpuMemoryBuffer::SCANOUT: {
+ const gfx::GpuMemoryBufferType supported_types[] = {
#if defined(OS_MACOSX)
- gfx::IO_SURFACE_BUFFER,
+ gfx::IO_SURFACE_BUFFER,
#endif
#if defined(OS_ANDROID)
- gfx::SURFACE_TEXTURE_BUFFER,
+ gfx::SURFACE_TEXTURE_BUFFER,
#endif
#if defined(USE_OZONE)
- gfx::OZONE_NATIVE_BUFFER,
+ gfx::OZONE_NATIVE_BUFFER,
#endif
- gfx::SHARED_MEMORY_BUFFER
- };
- types->assign(supported_types, supported_types + arraysize(supported_types));
+ gfx::SHARED_MEMORY_BUFFER
+ };
+ types->assign(supported_types,
+ supported_types + arraysize(supported_types));
+ break;
+ }
+ }
}
// static

Powered by Google App Engine
This is Rietveld 408576698