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

Unified Diff: ui/gl/gl_fence_shared_event.cc

Issue 2383753002: gpu: Add GpuFence framework.
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 side-by-side diff with in-line comments
Download patch
« ui/gfx/shared_event.cc ('K') | « ui/gl/gl_fence_shared_event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_fence_shared_event.cc
diff --git a/ui/gl/gl_fence_shared_event.cc b/ui/gl/gl_fence_shared_event.cc
new file mode 100644
index 0000000000000000000000000000000000000000..19e6ef93a2bb0f1ffd9ee0102e7fdd17208e6c24
--- /dev/null
+++ b/ui/gl/gl_fence_shared_event.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/gl_fence_shared_event.h"
+
+namespace gl {
+
+GLFenceSharedEvent::GLFenceSharedEvent(const gfx::SharedEventHandle& handle)
+ : shared_event_(handle) {
+ // Close shared memory segment to avoid running out of FDs.
+ shared_event_.Close();
ericrk 2017/03/10 03:04:39 So, to make sure I understand, closing this frees
reveman 2017/03/13 12:33:05 Correct. We do the same for shared bitmaps and dis
+}
+
+GLFenceSharedEvent::~GLFenceSharedEvent() {}
+
+bool GLFenceSharedEvent::HasCompleted() {
+ return shared_event_.IsSignaled();
+}
+
+void GLFenceSharedEvent::ClientWait() {
+ DLOG(WARNING) << "Unsupported fence operation";
+}
+
+void GLFenceSharedEvent::ServerWait() {
+ DLOG(WARNING) << "Unsupported fence operation";
+}
+
+bool GLFenceSharedEvent::SignalSupported() {
+ return true;
+}
+
+void GLFenceSharedEvent::Signal() {
+ shared_event_.Signal();
+}
+
+} // namespace gl
« ui/gfx/shared_event.cc ('K') | « ui/gl/gl_fence_shared_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698