| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_GPU_FENCE_H_ | 5 #ifndef UI_GFX_GPU_FENCE_H_ |
| 6 #define UI_GFX_GPU_FENCE_H_ | 6 #define UI_GFX_GPU_FENCE_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/gfx/gfx_export.h" | 9 #include "ui/gfx/gfx_export.h" |
| 10 #include "ui/gfx/shared_event.h" | 10 #include "ui/gfx/shared_event.h" |
| 11 | 11 |
| 12 #if defined(OS_LINUX) |
| 13 #include "base/file_descriptor_posix.h" |
| 14 #endif |
| 15 |
| 12 extern "C" typedef struct _ClientFence* ClientFence; | 16 extern "C" typedef struct _ClientFence* ClientFence; |
| 13 | 17 |
| 14 namespace gfx { | 18 namespace gfx { |
| 15 | 19 |
| 16 struct GFX_EXPORT GpuFenceHandle { | 20 struct GFX_EXPORT GpuFenceHandle { |
| 17 SharedEventHandle shared_event_handle; | 21 SharedEventHandle shared_event_handle; |
| 22 #if defined(OS_LINUX) |
| 23 base::FileDescriptor fd; |
| 24 #endif |
| 18 }; | 25 }; |
| 19 | 26 |
| 20 // This interface correspond to a type of fence that can be shared between | 27 // This interface correspond to a type of fence that can be shared between |
| 21 // processes and signaled by the GPU. | 28 // processes and signaled by the GPU. |
| 22 class GFX_EXPORT GpuFence { | 29 class GFX_EXPORT GpuFence { |
| 23 public: | 30 public: |
| 24 virtual ~GpuFence() {} | 31 virtual ~GpuFence() {} |
| 25 | 32 |
| 26 // Returns true if the fence is in the signaled state, else false. | 33 // Returns true if the fence is in the signaled state, else false. |
| 27 virtual bool IsSignaled() = 0; | 34 virtual bool IsSignaled() = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 38 // Returns a platform specific handle for this fence. | 45 // Returns a platform specific handle for this fence. |
| 39 virtual GpuFenceHandle GetHandle() const = 0; | 46 virtual GpuFenceHandle GetHandle() const = 0; |
| 40 | 47 |
| 41 // Type-checking downcast routine. | 48 // Type-checking downcast routine. |
| 42 virtual ClientFence AsClientFence() = 0; | 49 virtual ClientFence AsClientFence() = 0; |
| 43 }; | 50 }; |
| 44 | 51 |
| 45 } // namespace gfx | 52 } // namespace gfx |
| 46 | 53 |
| 47 #endif // UI_GFX_GPU_FENCE_H_ | 54 #endif // UI_GFX_GPU_FENCE_H_ |
| OLD | NEW |