OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 5 #ifndef GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
6 #define GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 6 #define GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void Flush(int32_t put_offset) override; | 80 void Flush(int32_t put_offset) override; |
81 void OrderingBarrier(int32_t put_offset) override; | 81 void OrderingBarrier(int32_t put_offset) override; |
82 void WaitForTokenInRange(int32_t start, int32_t end) override; | 82 void WaitForTokenInRange(int32_t start, int32_t end) override; |
83 void WaitForGetOffsetInRange(int32_t start, int32_t end) override; | 83 void WaitForGetOffsetInRange(int32_t start, int32_t end) override; |
84 void SetGetBuffer(int32_t shm_id) override; | 84 void SetGetBuffer(int32_t shm_id) override; |
85 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, | 85 scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size, |
86 int32_t* id) override; | 86 int32_t* id) override; |
87 void DestroyTransferBuffer(int32_t id) override; | 87 void DestroyTransferBuffer(int32_t id) override; |
88 | 88 |
89 // gpu::GpuControl implementation: | 89 // gpu::GpuControl implementation: |
| 90 void SetGpuControlClient(GpuControlClient* client) override; |
90 gpu::Capabilities GetCapabilities() override; | 91 gpu::Capabilities GetCapabilities() override; |
91 int32_t CreateImage(ClientBuffer buffer, | 92 int32_t CreateImage(ClientBuffer buffer, |
92 size_t width, | 93 size_t width, |
93 size_t height, | 94 size_t height, |
94 unsigned internal_format) override; | 95 unsigned internal_format) override; |
95 void DestroyImage(int32_t id) override; | 96 void DestroyImage(int32_t id) override; |
96 int32_t CreateGpuMemoryBufferImage(size_t width, | 97 int32_t CreateGpuMemoryBufferImage(size_t width, |
97 size_t height, | 98 size_t height, |
98 unsigned internal_format, | 99 unsigned internal_format, |
99 unsigned usage) override; | 100 unsigned usage) override; |
100 void SignalQuery(uint32_t query, const base::Closure& callback) override; | 101 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
101 void SetLock(base::Lock* lock) override; | 102 void SetLock(base::Lock* lock) override; |
102 bool IsGpuChannelLost() override; | 103 bool IsGpuChannelLost() override; |
103 void EnsureWorkVisible() override; | 104 void EnsureWorkVisible() override; |
104 gpu::CommandBufferNamespace GetNamespaceID() const override; | 105 gpu::CommandBufferNamespace GetNamespaceID() const override; |
105 gpu::CommandBufferId GetCommandBufferID() const override; | 106 gpu::CommandBufferId GetCommandBufferID() const override; |
106 int32_t GetExtraCommandBufferData() const override; | 107 int32_t GetExtraCommandBufferData() const override; |
107 uint64_t GenerateFenceSyncRelease() override; | 108 uint64_t GenerateFenceSyncRelease() override; |
108 bool IsFenceSyncRelease(uint64_t release) override; | 109 bool IsFenceSyncRelease(uint64_t release) override; |
109 bool IsFenceSyncFlushed(uint64_t release) override; | 110 bool IsFenceSyncFlushed(uint64_t release) override; |
110 bool IsFenceSyncFlushReceived(uint64_t release) override; | 111 bool IsFenceSyncFlushReceived(uint64_t release) override; |
111 void SignalSyncToken(const gpu::SyncToken& sync_token, | 112 void SignalSyncToken(const gpu::SyncToken& sync_token, |
112 const base::Closure& callback) override; | 113 const base::Closure& callback) override; |
113 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; | 114 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; |
114 | 115 |
115 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); | 116 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); |
116 void SetContextLostCallback(const base::Closure& callback); | |
117 | 117 |
118 void AddDeletionObserver(DeletionObserver* observer); | 118 void AddDeletionObserver(DeletionObserver* observer); |
119 void RemoveDeletionObserver(DeletionObserver* observer); | 119 void RemoveDeletionObserver(DeletionObserver* observer); |
120 | 120 |
121 bool EnsureBackbuffer(); | 121 bool EnsureBackbuffer(); |
122 | 122 |
123 void SetOnConsoleMessageCallback(const GpuConsoleMessageCallback& callback); | 123 void SetOnConsoleMessageCallback(const GpuConsoleMessageCallback& callback); |
124 | 124 |
125 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); | 125 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
126 using SwapBuffersCompletionCallback = | 126 using SwapBuffersCompletionCallback = |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // process. Will post a task to call the lost context callback if any. | 190 // process. Will post a task to call the lost context callback if any. |
191 void InvalidGpuReply(); | 191 void InvalidGpuReply(); |
192 | 192 |
193 void InvalidGpuReplyOnClientThread(); | 193 void InvalidGpuReplyOnClientThread(); |
194 | 194 |
195 // The shared memory area used to update state. | 195 // The shared memory area used to update state. |
196 gpu::CommandBufferSharedState* shared_state() const; | 196 gpu::CommandBufferSharedState* shared_state() const; |
197 | 197 |
198 base::Lock* lock_; | 198 base::Lock* lock_; |
199 | 199 |
| 200 // Client that wants to listen for important events on the GpuControl. |
| 201 gpu::GpuControlClient* gpu_control_client_; |
| 202 |
200 // Unowned list of DeletionObservers. | 203 // Unowned list of DeletionObservers. |
201 base::ObserverList<DeletionObserver> deletion_observers_; | 204 base::ObserverList<DeletionObserver> deletion_observers_; |
202 | 205 |
203 // The last cached state received from the service. | 206 // The last cached state received from the service. |
204 State last_state_; | 207 State last_state_; |
205 | 208 |
206 // The shared memory area used to update state. | 209 // The shared memory area used to update state. |
207 scoped_ptr<base::SharedMemory> shared_state_shm_; | 210 scoped_ptr<base::SharedMemory> shared_state_shm_; |
208 | 211 |
209 // |*this| is owned by |*channel_| and so is always outlived by it, so using a | 212 // |*this| is owned by |*channel_| and so is always outlived by it, so using a |
(...skipping 11 matching lines...) Expand all Loading... |
221 | 224 |
222 // Unverified flushed fence syncs with their corresponding flush id. | 225 // Unverified flushed fence syncs with their corresponding flush id. |
223 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; | 226 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; |
224 | 227 |
225 // Last flushed fence sync release, same as last item in queue if not empty. | 228 // Last flushed fence sync release, same as last item in queue if not empty. |
226 uint64_t flushed_fence_sync_release_; | 229 uint64_t flushed_fence_sync_release_; |
227 | 230 |
228 // Last verified fence sync. | 231 // Last verified fence sync. |
229 uint64_t verified_fence_sync_release_; | 232 uint64_t verified_fence_sync_release_; |
230 | 233 |
231 base::Closure context_lost_callback_; | |
232 | |
233 GpuConsoleMessageCallback console_message_callback_; | 234 GpuConsoleMessageCallback console_message_callback_; |
234 | 235 |
235 // Tasks to be invoked in SignalSyncPoint responses. | 236 // Tasks to be invoked in SignalSyncPoint responses. |
236 uint32_t next_signal_id_; | 237 uint32_t next_signal_id_; |
237 SignalTaskMap signal_tasks_; | 238 SignalTaskMap signal_tasks_; |
238 | 239 |
239 gpu::Capabilities capabilities_; | 240 gpu::Capabilities capabilities_; |
240 | 241 |
241 std::vector<ui::LatencyInfo> latency_info_; | 242 std::vector<ui::LatencyInfo> latency_info_; |
242 | 243 |
243 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 244 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
244 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 245 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
245 | 246 |
246 base::WeakPtr<CommandBufferProxyImpl> weak_this_; | 247 base::WeakPtr<CommandBufferProxyImpl> weak_this_; |
247 scoped_refptr<base::SequencedTaskRunner> callback_thread_; | 248 scoped_refptr<base::SequencedTaskRunner> callback_thread_; |
248 | 249 |
249 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 250 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
250 }; | 251 }; |
251 | 252 |
252 } // namespace gpu | 253 } // namespace gpu |
253 | 254 |
254 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 255 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |