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

Side by Side Diff: gpu/ipc/client/gpu_fence_impl_libsync.cc

Issue 2384243003: ui: Add libsync GLFence implementation.
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « gpu/ipc/client/gpu_fence_impl_libsync.h ('k') | gpu/ipc/client/gpu_fence_impl_shared_event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gpu/ipc/client/gpu_fence_impl_libsync.h"
6
7 #include "third_party/libsync/include/sync/sync.h"
8
9 namespace gpu {
10
11 GpuFenceImplLibsync::GpuFenceImplLibsync(const base::FileDescriptor& fd)
12 : fd_(fd.fd) {}
13
14 GpuFenceImplLibsync::~GpuFenceImplLibsync() {}
15
16 bool GpuFenceImplLibsync::IsSignaled() {
17 int rv = sync_wait(fd_.get(), 0);
18 PLOG_IF(ERROR, rv < 0) << "sync_wait failed: " << rv;
19 return !rv;
20 }
21
22 bool GpuFenceImplLibsync::Wait(const base::TimeDelta& max_time) {
23 int rv = sync_wait(fd_.get(), max_time.InMilliseconds());
24 PLOG_IF(ERROR, rv < 0) << "sync_wait failed: " << rv;
25 return !rv;
26 }
27
28 gfx::GpuFenceHandle GpuFenceImplLibsync::GetHandle() const {
29 gfx::GpuFenceHandle handle;
30 handle.fd.fd = fd_.get();
31 handle.fd.auto_close = false;
32 return handle;
33 }
34
35 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_fence_impl_libsync.h ('k') | gpu/ipc/client/gpu_fence_impl_shared_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698