OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "gpu/command_buffer/common/capabilities.h" | 15 #include "gpu/command_buffer/common/capabilities.h" |
16 #include "gpu/command_buffer/common/command_buffer_id.h" | 16 #include "gpu/command_buffer/common/command_buffer_id.h" |
17 #include "gpu/command_buffer/common/constants.h" | 17 #include "gpu/command_buffer/common/constants.h" |
18 #include "gpu/command_buffer/common/mailbox.h" | 18 #include "gpu/command_buffer/common/mailbox.h" |
19 #include "gpu/gpu_export.h" | 19 #include "gpu/gpu_export.h" |
20 | 20 |
21 extern "C" typedef struct _ClientBuffer* ClientBuffer; | 21 extern "C" typedef struct _ClientBuffer* ClientBuffer; |
| 22 extern "C" typedef struct _ClientFence* ClientFence; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class Lock; | 25 class Lock; |
25 } | 26 } |
26 | 27 |
27 namespace gfx { | 28 namespace gfx { |
28 class GpuMemoryBuffer; | 29 class GpuMemoryBuffer; |
29 } | 30 } |
30 | 31 |
31 namespace gpu { | 32 namespace gpu { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Runs |callback| when sync token is signalled. | 102 // Runs |callback| when sync token is signalled. |
102 virtual void SignalSyncToken(const SyncToken& sync_token, | 103 virtual void SignalSyncToken(const SyncToken& sync_token, |
103 const base::Closure& callback) = 0; | 104 const base::Closure& callback) = 0; |
104 | 105 |
105 // Under some circumstances a sync token may be used which has not been | 106 // Under some circumstances a sync token may be used which has not been |
106 // verified to have been flushed. For example, fence syncs queued on the | 107 // verified to have been flushed. For example, fence syncs queued on the |
107 // same channel as the wait command guarantee that the fence sync will | 108 // same channel as the wait command guarantee that the fence sync will |
108 // be enqueued first so does not need to be flushed. | 109 // be enqueued first so does not need to be flushed. |
109 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; | 110 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; |
110 | 111 |
| 112 // Create a fence for a client fence. Returns its ID or -1 on error. |
| 113 virtual int32_t CreateFence(ClientFence fence) = 0; |
| 114 |
| 115 // Destroy a fence. The ID must be positive. |
| 116 virtual void DestroyFence(int32_t id) = 0; |
| 117 |
111 private: | 118 private: |
112 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 119 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
113 }; | 120 }; |
114 | 121 |
115 } // namespace gpu | 122 } // namespace gpu |
116 | 123 |
117 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 124 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
OLD | NEW |