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

Unified Diff: ui/gfx/gpu_memory_buffer.cc

Issue 2970353002: Add GpuMemoryBuffer support for DXGI handles.
Patch Set: update build config Created 3 years, 4 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 | « ui/gfx/gpu_memory_buffer.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gpu_memory_buffer.cc
diff --git a/ui/gfx/gpu_memory_buffer.cc b/ui/gfx/gpu_memory_buffer.cc
index e4e42434fabf9a5af5ab637e18ddee10768fdd13..df4dbddc9b472ef21ce0f05f6dd2bf7df425b9bc 100644
--- a/ui/gfx/gpu_memory_buffer.cc
+++ b/ui/gfx/gpu_memory_buffer.cc
@@ -31,6 +31,9 @@ GpuMemoryBufferHandle CloneHandleForIPC(
handle.handle = base::SharedMemory::DuplicateHandle(source_handle.handle);
handle.offset = source_handle.offset;
handle.stride = source_handle.stride;
+#if defined(OS_WIN)
+ handle.array_level = source_handle.array_level;
+#endif
return handle;
}
case gfx::NATIVE_PIXMAP: {
@@ -45,6 +48,15 @@ GpuMemoryBufferHandle CloneHandleForIPC(
}
case gfx::IO_SURFACE_BUFFER:
return source_handle;
+ case gfx::DXGI_HANDLE:
+ gfx::GpuMemoryBufferHandle handle;
+ handle.type = gfx::DXGI_HANDLE;
+ handle.id = source_handle.id;
+ handle.handle = base::SharedMemory::DuplicateHandle(source_handle.handle);
+#if defined(OS_WIN)
+ handle.array_level = source_handle.array_level;
+#endif
+ return handle;
}
return gfx::GpuMemoryBufferHandle();
}
« no previous file with comments | « ui/gfx/gpu_memory_buffer.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698