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

Unified Diff: ui/gfx/gpu_fence.h

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
Index: ui/gfx/gpu_fence.h
diff --git a/ui/gfx/gpu_fence.h b/ui/gfx/gpu_fence.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0f9666cb60f325a1435019218cdc083d5edd5e8
--- /dev/null
+++ b/ui/gfx/gpu_fence.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef UI_GFX_GPU_FENCE_H_
+#define UI_GFX_GPU_FENCE_H_
+
+#include "base/time/time.h"
+#include "ui/gfx/gfx_export.h"
+#include "ui/gfx/shared_event.h"
+
+extern "C" typedef struct _ClientFence* ClientFence;
+
+namespace gfx {
+
+struct GFX_EXPORT GpuFenceHandle {
+ SharedEventHandle shared_event_handle;
+};
+
+// This interface correspond to a type of fence that can be shared between
+// processes and signaled by the GPU.
+class GFX_EXPORT GpuFence {
+ public:
+ virtual ~GpuFence() {}
+
+ // Returns true if the fence is in the signaled state, else false.
+ virtual bool IsSignaled() = 0;
+
+ // Wait up until max_time has passed for the fence to be signaled. Returns
+ // true if the fence was signaled. If this method returns false, then it
+ // does not necessarily mean that |max_time| was exceeded.
+ virtual bool Wait(const base::TimeDelta& max_time) = 0;
+
+ // Reset that state of fence to 'unsignaled'. Calling this when the fence
+ // is not 'signaled' is an error.
+ virtual void Reset() = 0;
+
+ // Returns a platform specific handle for this fence.
+ virtual GpuFenceHandle GetHandle() const = 0;
+
+ // Type-checking downcast routine.
+ virtual ClientFence AsClientFence() = 0;
+};
+
+} // namespace gfx
+
+#endif // UI_GFX_GPU_FENCE_H_

Powered by Google App Engine
This is Rietveld 408576698