| 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() {
|
|
|