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

Unified Diff: gpu/ipc/client/gpu_fence_impl.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.h ('k') | gpu/ipc/client/gpu_fence_impl_libsync.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/gpu_fence_impl.cc
diff --git a/gpu/ipc/client/gpu_fence_impl.cc b/gpu/ipc/client/gpu_fence_impl.cc
index 722cf8e7188c4e5896d410dbf5cf973c6c29c7dc..e2508e86144eead9a94fa2a92f20fb133b725301 100644
--- a/gpu/ipc/client/gpu_fence_impl.cc
+++ b/gpu/ipc/client/gpu_fence_impl.cc
@@ -5,15 +5,18 @@
#include "gpu/ipc/client/gpu_fence_impl.h"
#include "base/logging.h"
-#include "build/build_config.h"
+#include "base/memory/ptr_util.h"
+#include "gpu/ipc/client/gpu_fence_impl_shared_event.h"
+#include "ui/gfx/shared_event.h"
+
+#if defined(OS_LINUX)
+#include "gpu/ipc/client/gpu_fence_impl_libsync.h"
+#endif
namespace gpu {
GpuFenceImpl::GpuFenceImpl() {}
-GpuFenceImpl::GpuFenceImpl(const gfx::GpuFenceHandle& handle)
- : shared_event_(handle.shared_event_handle) {}
-
GpuFenceImpl::~GpuFenceImpl() {}
// static
@@ -26,26 +29,36 @@ gfx::GpuFenceHandle GpuFenceImpl::CreateForChildProcess(
}
// static
+std::unique_ptr<GpuFenceImpl> GpuFenceImpl::CreateFromHandle(
+ const gfx::GpuFenceHandle& handle) {
+ if (gfx::SharedEvent::IsHandleValid(handle.shared_event_handle)) {
+ return base::MakeUnique<GpuFenceImplSharedEvent>(
+ handle.shared_event_handle);
+ }
+#if defined(OS_LINUX)
+ if (handle.fd.fd >= 0)
+ return base::MakeUnique<GpuFenceImplLibsync>(handle.fd);
+#endif
+ return nullptr;
+}
+
+// static
GpuFenceImpl* GpuFenceImpl::FromClientFence(ClientFence fence) {
return reinterpret_cast<GpuFenceImpl*>(fence);
}
bool GpuFenceImpl::IsSignaled() {
- return shared_event_.IsSignaled();
+ NOTIMPLEMENTED();
+ return false;
}
bool GpuFenceImpl::Wait(const base::TimeDelta& max_time) {
- return shared_event_.Wait(max_time);
+ NOTIMPLEMENTED();
+ return false;
}
void GpuFenceImpl::Reset() {
- return shared_event_.Reset();
-}
-
-gfx::GpuFenceHandle GpuFenceImpl::GetHandle() const {
- gfx::GpuFenceHandle handle;
- handle.shared_event_handle = shared_event_.GetHandle();
- return handle;
+ NOTIMPLEMENTED();
}
ClientFence GpuFenceImpl::AsClientFence() {
« no previous file with comments | « gpu/ipc/client/gpu_fence_impl.h ('k') | gpu/ipc/client/gpu_fence_impl_libsync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698