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

Unified Diff: gpu/ipc/client/gpu_fence_impl.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: gpu/ipc/client/gpu_fence_impl.h
diff --git a/gpu/ipc/client/gpu_fence_impl.h b/gpu/ipc/client/gpu_fence_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c82d014981839e369ce567cd8979e4f6472813f
--- /dev/null
+++ b/gpu/ipc/client/gpu_fence_impl.h
@@ -0,0 +1,42 @@
+// 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 GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_
+#define GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_
+
+#include "gpu/gpu_export.h"
+#include "ui/gfx/gpu_fence.h"
+#include "ui/gfx/shared_event.h"
+
+namespace gpu {
+
+// Provides common implementation of a GPU fence.
+class GPU_EXPORT GpuFenceImpl : public gfx::GpuFence {
+ public:
+ GpuFenceImpl();
+ explicit GpuFenceImpl(const gfx::GpuFenceHandle& handle);
+ ~GpuFenceImpl() override;
+
+ static gfx::GpuFenceHandle CreateForChildProcess(
+ base::ProcessHandle child_process);
+
+ // Type-checking upcast routine. Returns an NULL on failure.
+ static GpuFenceImpl* FromClientFence(ClientFence fence);
+
+ // Overridden from gfx::GpuFence:
+ bool IsSignaled() override;
+ bool Wait(const base::TimeDelta& max_time) override;
+ void Reset() override;
+ gfx::GpuFenceHandle GetHandle() const override;
+ ClientFence AsClientFence() override;
+
+ private:
+ gfx::SharedEvent shared_event_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuFenceImpl);
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_CLIENT_GPU_FENCE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698