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

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

Issue 2384243003: ui: Add libsync GLFence implementation.
Patch Set: rebase Created 4 years, 2 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/client/DEPS ('k') | gpu/ipc/client/gpu_fence_impl.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 c44cd9ac61b3439a19bd111af9d935aca73002a7..850eaa30ed640e88d178d6ad97e5385035925a18 100644
--- a/gpu/ipc/client/gpu_channel_host.cc
+++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -286,8 +286,16 @@ int32_t GpuChannelHost::ReserveImageId() {
gfx::GpuFenceHandle GpuChannelHost::ShareGpuFenceToGpuProcess(
const gfx::GpuFenceHandle& source_handle) {
gfx::GpuFenceHandle handle;
- handle.shared_event_handle =
- gfx::SharedEvent::DuplicateHandle(source_handle.shared_event_handle);
+ if (gfx::SharedEvent::IsHandleValid(source_handle.shared_event_handle)) {
+ handle.shared_event_handle =
+ gfx::SharedEvent::DuplicateHandle(source_handle.shared_event_handle);
+ }
+#if defined(OS_LINUX)
+ if (source_handle.fd.fd >= 0) {
+ handle.fd.fd = HANDLE_EINTR(dup(source_handle.fd.fd));
+ handle.fd.auto_close = true;
+ }
+#endif
return handle;
}
« no previous file with comments | « gpu/ipc/client/DEPS ('k') | gpu/ipc/client/gpu_fence_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698