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; | |
91 gpu::Capabilities GetCapabilities() override; | 90 gpu::Capabilities GetCapabilities() override; |
92 int32_t CreateImage(ClientBuffer buffer, | 91 int32_t CreateImage(ClientBuffer buffer, |
93 size_t width, | 92 size_t width, |
94 size_t height, | 93 size_t height, |
95 unsigned internal_format) override; | 94 unsigned internal_format) override; |
96 void DestroyImage(int32_t id) override; | 95 void DestroyImage(int32_t id) override; |
97 int32_t CreateGpuMemoryBufferImage(size_t width, | 96 int32_t CreateGpuMemoryBufferImage(size_t width, |
98 size_t height, | 97 size_t height, |
99 unsigned internal_format, | 98 unsigned internal_format, |
100 unsigned usage) override; | 99 unsigned usage) override; |
101 void SignalQuery(uint32_t query, const base::Closure& callback) override; | 100 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
102 void SetLock(base::Lock* lock) override; | 101 void SetLock(base::Lock* lock) override; |
103 bool IsGpuChannelLost() override; | 102 bool IsGpuChannelLost() override; |
104 void EnsureWorkVisible() override; | 103 void EnsureWorkVisible() override; |
105 gpu::CommandBufferNamespace GetNamespaceID() const override; | 104 gpu::CommandBufferNamespace GetNamespaceID() const override; |
106 gpu::CommandBufferId GetCommandBufferID() const override; | 105 gpu::CommandBufferId GetCommandBufferID() const override; |
107 int32_t GetExtraCommandBufferData() const override; | 106 int32_t GetExtraCommandBufferData() const override; |
108 uint64_t GenerateFenceSyncRelease() override; | 107 uint64_t GenerateFenceSyncRelease() override; |
109 bool IsFenceSyncRelease(uint64_t release) override; | 108 bool IsFenceSyncRelease(uint64_t release) override; |
110 bool IsFenceSyncFlushed(uint64_t release) override; | 109 bool IsFenceSyncFlushed(uint64_t release) override; |
111 bool IsFenceSyncFlushReceived(uint64_t release) override; | 110 bool IsFenceSyncFlushReceived(uint64_t release) override; |
112 void SignalSyncToken(const gpu::SyncToken& sync_token, | 111 void SignalSyncToken(const gpu::SyncToken& sync_token, |
113 const base::Closure& callback) override; | 112 const base::Closure& callback) override; |
114 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; | 113 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; |
115 | 114 |
116 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); | 115 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 | |
203 // Unowned list of DeletionObservers. | 200 // Unowned list of DeletionObservers. |
204 base::ObserverList<DeletionObserver> deletion_observers_; | 201 base::ObserverList<DeletionObserver> deletion_observers_; |
205 | 202 |
206 // The last cached state received from the service. | 203 // The last cached state received from the service. |
207 State last_state_; | 204 State last_state_; |
208 | 205 |
209 // The shared memory area used to update state. | 206 // The shared memory area used to update state. |
210 scoped_ptr<base::SharedMemory> shared_state_shm_; | 207 scoped_ptr<base::SharedMemory> shared_state_shm_; |
211 | 208 |
212 // |*this| is owned by |*channel_| and so is always outlived by it, so using a | 209 // |*this| is owned by |*channel_| and so is always outlived by it, so using a |
(...skipping 11 matching lines...) Expand all Loading... |
224 | 221 |
225 // Unverified flushed fence syncs with their corresponding flush id. | 222 // Unverified flushed fence syncs with their corresponding flush id. |
226 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; | 223 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; |
227 | 224 |
228 // Last flushed fence sync release, same as last item in queue if not empty. | 225 // Last flushed fence sync release, same as last item in queue if not empty. |
229 uint64_t flushed_fence_sync_release_; | 226 uint64_t flushed_fence_sync_release_; |
230 | 227 |
231 // Last verified fence sync. | 228 // Last verified fence sync. |
232 uint64_t verified_fence_sync_release_; | 229 uint64_t verified_fence_sync_release_; |
233 | 230 |
| 231 base::Closure context_lost_callback_; |
| 232 |
234 GpuConsoleMessageCallback console_message_callback_; | 233 GpuConsoleMessageCallback console_message_callback_; |
235 | 234 |
236 // Tasks to be invoked in SignalSyncPoint responses. | 235 // Tasks to be invoked in SignalSyncPoint responses. |
237 uint32_t next_signal_id_; | 236 uint32_t next_signal_id_; |
238 SignalTaskMap signal_tasks_; | 237 SignalTaskMap signal_tasks_; |
239 | 238 |
240 gpu::Capabilities capabilities_; | 239 gpu::Capabilities capabilities_; |
241 | 240 |
242 std::vector<ui::LatencyInfo> latency_info_; | 241 std::vector<ui::LatencyInfo> latency_info_; |
243 | 242 |
244 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 243 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
245 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 244 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
246 | 245 |
247 base::WeakPtr<CommandBufferProxyImpl> weak_this_; | 246 base::WeakPtr<CommandBufferProxyImpl> weak_this_; |
248 scoped_refptr<base::SequencedTaskRunner> callback_thread_; | 247 scoped_refptr<base::SequencedTaskRunner> callback_thread_; |
249 | 248 |
250 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 249 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
251 }; | 250 }; |
252 | 251 |
253 } // namespace gpu | 252 } // namespace gpu |
254 | 253 |
255 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 254 #endif // GPU_IPC_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |