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

Unified Diff: gpu/ipc/client/gpu_channel_host.cc

Issue 1837703002: gpu: Export/import buffers created by Ozone GMB factory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move dup() to ShareGpuMemoryBufferToGpuProcess Created 4 years, 6 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 | « no previous file | gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/gpu_channel_host.cc
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc
index ddadbdf684addcc1808457645fb36da5a1b5656c..91a881e4421c9b95274c8b76bb8832b385c81d60 100644
--- a/gpu/ipc/client/gpu_channel_host.cc
+++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -242,9 +242,32 @@ gfx::GpuMemoryBufferHandle GpuChannelHost::ShareGpuMemoryBufferToGpuProcess(
*requires_sync_point = false;
return handle;
}
+#if defined(USE_OZONE)
+ case gfx::OZONE_NATIVE_PIXMAP: {
+ std::vector<base::ScopedFD> scoped_fds;
+ for (auto& fd : source_handle.native_pixmap_handle.fds) {
+ base::ScopedFD scoped_fd(HANDLE_EINTR(dup(fd.fd)));
+ if (!scoped_fd.is_valid()) {
+ PLOG(ERROR) << "dup";
+ return gfx::GpuMemoryBufferHandle();
+ }
+ scoped_fds.emplace_back(std::move(scoped_fd));
+ }
+ gfx::GpuMemoryBufferHandle handle;
+ handle.type = gfx::OZONE_NATIVE_PIXMAP;
+ handle.id = source_handle.id;
+ for (auto& scoped_fd : scoped_fds) {
+ handle.native_pixmap_handle.fds.emplace_back(scoped_fd.release(),
+ true /* auto_close */);
+ }
+ handle.native_pixmap_handle.strides_and_offsets =
+ source_handle.native_pixmap_handle.strides_and_offsets;
+ *requires_sync_point = false;
+ return handle;
+ }
+#endif
case gfx::IO_SURFACE_BUFFER:
case gfx::SURFACE_TEXTURE_BUFFER:
- case gfx::OZONE_NATIVE_PIXMAP:
*requires_sync_point = true;
return source_handle;
default:
« no previous file with comments | « no previous file | gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698