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 CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void RetireSyncPoint(uint32_t sync_point) override; | 116 void RetireSyncPoint(uint32_t sync_point) override; |
117 void SignalSyncPoint(uint32 sync_point, | 117 void SignalSyncPoint(uint32 sync_point, |
118 const base::Closure& callback) override; | 118 const base::Closure& callback) override; |
119 void SignalQuery(uint32 query, const base::Closure& callback) override; | 119 void SignalQuery(uint32 query, const base::Closure& callback) override; |
120 void SetSurfaceVisible(bool visible) override; | 120 void SetSurfaceVisible(bool visible) override; |
121 uint32 CreateStreamTexture(uint32 texture_id) override; | 121 uint32 CreateStreamTexture(uint32 texture_id) override; |
122 void SetLock(base::Lock* lock) override; | 122 void SetLock(base::Lock* lock) override; |
123 bool IsGpuChannelLost() override; | 123 bool IsGpuChannelLost() override; |
124 gpu::CommandBufferNamespace GetNamespaceID() const override; | 124 gpu::CommandBufferNamespace GetNamespaceID() const override; |
125 uint64_t GetCommandBufferID() const override; | 125 uint64_t GetCommandBufferID() const override; |
| 126 uint64_t GenerateFenceSyncRelease() override;; |
| 127 bool IsFenceSyncRelease(uint64_t release) override; |
| 128 bool IsFenceSyncFlushed(uint64_t release) override; |
126 | 129 |
127 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); | 130 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); |
128 void SetContextLostCallback(const base::Closure& callback); | 131 void SetContextLostCallback(const base::Closure& callback); |
129 | 132 |
130 typedef base::Callback<void(const gpu::MemoryAllocation&)> | 133 typedef base::Callback<void(const gpu::MemoryAllocation&)> |
131 MemoryAllocationChangedCallback; | 134 MemoryAllocationChangedCallback; |
132 void SetMemoryAllocationChangedCallback( | 135 void SetMemoryAllocationChangedCallback( |
133 const MemoryAllocationChangedCallback& callback); | 136 const MemoryAllocationChangedCallback& callback); |
134 void AddDeletionObserver(DeletionObserver* observer); | 137 void AddDeletionObserver(DeletionObserver* observer); |
135 void RemoveDeletionObserver(DeletionObserver* observer); | 138 void RemoveDeletionObserver(DeletionObserver* observer); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); | 192 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); |
190 void OnSignalSyncPointAck(uint32 id); | 193 void OnSignalSyncPointAck(uint32 id); |
191 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, | 194 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, |
192 gfx::SwapResult result); | 195 gfx::SwapResult result); |
193 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 196 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
194 base::TimeDelta interval); | 197 base::TimeDelta interval); |
195 | 198 |
196 // Try to read an updated copy of the state from shared memory. | 199 // Try to read an updated copy of the state from shared memory. |
197 void TryUpdateState(); | 200 void TryUpdateState(); |
198 | 201 |
| 202 // Updates the highest verified release fence sync. |
| 203 void UpdateVerifiedReleases(uint32_t verified_flush); |
| 204 |
199 // The shared memory area used to update state. | 205 // The shared memory area used to update state. |
200 gpu::CommandBufferSharedState* shared_state() const; | 206 gpu::CommandBufferSharedState* shared_state() const; |
201 | 207 |
202 base::Lock* lock_; | 208 base::Lock* lock_; |
203 | 209 |
204 // Unowned list of DeletionObservers. | 210 // Unowned list of DeletionObservers. |
205 base::ObserverList<DeletionObserver> deletion_observers_; | 211 base::ObserverList<DeletionObserver> deletion_observers_; |
206 | 212 |
207 // The last cached state received from the service. | 213 // The last cached state received from the service. |
208 State last_state_; | 214 State last_state_; |
209 | 215 |
210 // The shared memory area used to update state. | 216 // The shared memory area used to update state. |
211 scoped_ptr<base::SharedMemory> shared_state_shm_; | 217 scoped_ptr<base::SharedMemory> shared_state_shm_; |
212 | 218 |
213 // |*this| is owned by |*channel_| and so is always outlived by it, so using a | 219 // |*this| is owned by |*channel_| and so is always outlived by it, so using a |
214 // raw pointer is ok. | 220 // raw pointer is ok. |
215 GpuChannelHost* channel_; | 221 GpuChannelHost* channel_; |
216 const uint64_t command_buffer_id_; | 222 const uint64_t command_buffer_id_; |
217 const int32 route_id_; | 223 const int32 route_id_; |
218 const int32 stream_id_; | 224 const int32 stream_id_; |
219 uint32 flush_count_; | 225 uint32 flush_count_; |
220 int32 last_put_offset_; | 226 int32 last_put_offset_; |
221 int32 last_barrier_put_offset_; | 227 int32 last_barrier_put_offset_; |
222 | 228 |
| 229 // Next generated fence sync. |
| 230 uint64_t next_fence_sync_release_; |
| 231 |
| 232 // Unverified flushed fence syncs with their corresponding flush id. |
| 233 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; |
| 234 |
| 235 // Last flushed fence sync release, same as last item in queue if not empty. |
| 236 uint64_t flushed_fence_sync_release_; |
| 237 |
| 238 // Last verified fence sync. |
| 239 uint64_t verified_fence_sync_release_; |
| 240 |
223 base::Closure context_lost_callback_; | 241 base::Closure context_lost_callback_; |
224 | 242 |
225 MemoryAllocationChangedCallback memory_allocation_changed_callback_; | 243 MemoryAllocationChangedCallback memory_allocation_changed_callback_; |
226 | 244 |
227 GpuConsoleMessageCallback console_message_callback_; | 245 GpuConsoleMessageCallback console_message_callback_; |
228 | 246 |
229 // Tasks to be invoked in SignalSyncPoint responses. | 247 // Tasks to be invoked in SignalSyncPoint responses. |
230 uint32 next_signal_id_; | 248 uint32 next_signal_id_; |
231 SignalTaskMap signal_tasks_; | 249 SignalTaskMap signal_tasks_; |
232 | 250 |
233 gpu::Capabilities capabilities_; | 251 gpu::Capabilities capabilities_; |
234 | 252 |
235 std::vector<ui::LatencyInfo> latency_info_; | 253 std::vector<ui::LatencyInfo> latency_info_; |
236 | 254 |
237 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 255 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
238 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 256 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
239 | 257 |
240 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 258 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
241 }; | 259 }; |
242 | 260 |
243 } // namespace content | 261 } // namespace content |
244 | 262 |
245 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 263 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |