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

Unified Diff: gpu/ipc/service/gpu_channel.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/gpu_fence_impl_shared_event.cc ('k') | third_party/libsync/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_channel.cc
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
index 2c672d6d4bc6454e7ee2ebe342a07f36ca6513d1..60838010ba0fb741c63571120506c71d6a7e5e26 100644
--- a/gpu/ipc/service/gpu_channel.cc
+++ b/gpu/ipc/service/gpu_channel.cc
@@ -51,6 +51,10 @@
#include "ipc/ipc_channel_posix.h"
#endif
+#if defined(OS_LINUX)
+#include "ui/gl/gl_fence_libsync.h"
+#endif
+
namespace gpu {
namespace {
@@ -1072,6 +1076,12 @@ scoped_refptr<gl::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer(
std::unique_ptr<gl::GLFence> GpuChannel::CreateFenceForGpuFence(
const gfx::GpuFenceHandle& handle) {
+#if defined(OS_LINUX)
+ base::ScopedFD libsync_fd(handle.fd.fd);
+ if (libsync_fd.is_valid())
+ return base::MakeUnique<gl::GLFenceLibsync>(std::move(libsync_fd));
+#endif
+
return base::MakeUnique<gl::GLFenceSharedEvent>(handle.shared_event_handle);
}
« no previous file with comments | « gpu/ipc/client/gpu_fence_impl_shared_event.cc ('k') | third_party/libsync/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698