OLD | NEW |
(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 #ifndef UI_GFX_GPU_FENCE_H_ |
| 6 #define UI_GFX_GPU_FENCE_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 #include "ui/gfx/gfx_export.h" |
| 10 #include "ui/gfx/shared_event.h" |
| 11 |
| 12 extern "C" typedef struct _ClientFence* ClientFence; |
| 13 |
| 14 namespace gfx { |
| 15 |
| 16 struct GFX_EXPORT GpuFenceHandle { |
| 17 SharedEventHandle shared_event_handle; |
| 18 }; |
| 19 |
| 20 // This interface correspond to a type of fence that can be shared between |
| 21 // processes and signaled by the GPU. |
| 22 class GFX_EXPORT GpuFence { |
| 23 public: |
| 24 virtual ~GpuFence() {} |
| 25 |
| 26 // Returns true if the fence is in the signaled state, else false. |
| 27 virtual bool IsSignaled() = 0; |
| 28 |
| 29 // Wait up until max_time has passed for the fence to be signaled. Returns |
| 30 // true if the fence was signaled. If this method returns false, then it |
| 31 // does not necessarily mean that |max_time| was exceeded. |
| 32 virtual bool Wait(const base::TimeDelta& max_time) = 0; |
| 33 |
| 34 // Reset that state of fence to 'unsignaled'. Calling this when the fence |
| 35 // is not 'signaled' is an error. |
| 36 virtual void Reset() = 0; |
| 37 |
| 38 // Returns a platform specific handle for this fence. |
| 39 virtual GpuFenceHandle GetHandle() const = 0; |
| 40 |
| 41 // Type-checking downcast routine. |
| 42 virtual ClientFence AsClientFence() = 0; |
| 43 }; |
| 44 |
| 45 } // namespace gfx |
| 46 |
| 47 #endif // UI_GFX_GPU_FENCE_H_ |
OLD | NEW |