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

Side by Side Diff: ui/gl/gl_fence_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 | « ui/gl/gl_fence_libsync.h ('k') | no next file » | 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 "ui/gl/gl_fence_libsync.h"
6
7 #include "base/trace_event/trace_event.h"
8 #include "third_party/libsync/include/sync/sync.h"
9
10 namespace gl {
11
12 GLFenceLibsync::GLFenceLibsync(base::ScopedFD fd) : fd_(std::move(fd)) {}
13
14 GLFenceLibsync::~GLFenceLibsync() {}
15
16 bool GLFenceLibsync::HasCompleted() {
17 int rv = sync_wait(fd_.get(), 0);
18 PLOG_IF(ERROR, rv < 0) << "sync_wait failed: " << rv;
19 return !rv;
20 }
21
22 void GLFenceLibsync::ClientWait() {
23 TRACE_EVENT0("gpu", "GLFenceLibsync::ClientWait");
24 int rv = sync_wait(fd_.get(), -1);
25 PLOG_IF(ERROR, rv < 0) << "sync_wait failed: " << rv;
26 }
27
28 void GLFenceLibsync::ServerWait() {
29 ClientWait();
30 }
31
32 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_fence_libsync.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698