| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 124 |
| 125 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); | 125 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); |
| 126 void SetContextLostCallback(const base::Closure& callback); | 126 void SetContextLostCallback(const base::Closure& callback); |
| 127 | 127 |
| 128 typedef base::Callback<void(const gpu::MemoryAllocation&)> | |
| 129 MemoryAllocationChangedCallback; | |
| 130 void SetMemoryAllocationChangedCallback( | |
| 131 const MemoryAllocationChangedCallback& callback); | |
| 132 void AddDeletionObserver(DeletionObserver* observer); | 128 void AddDeletionObserver(DeletionObserver* observer); |
| 133 void RemoveDeletionObserver(DeletionObserver* observer); | 129 void RemoveDeletionObserver(DeletionObserver* observer); |
| 134 | 130 |
| 135 bool EnsureBackbuffer(); | 131 bool EnsureBackbuffer(); |
| 136 | 132 |
| 137 void SetOnConsoleMessageCallback( | 133 void SetOnConsoleMessageCallback( |
| 138 const GpuConsoleMessageCallback& callback); | 134 const GpuConsoleMessageCallback& callback); |
| 139 | 135 |
| 140 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); | 136 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
| 141 using SwapBuffersCompletionCallback = | 137 using SwapBuffersCompletionCallback = |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // Send an IPC message over the GPU channel. This is private to fully | 173 // Send an IPC message over the GPU channel. This is private to fully |
| 178 // encapsulate the channel; all callers of this function must explicitly | 174 // encapsulate the channel; all callers of this function must explicitly |
| 179 // verify that the context has not been lost. | 175 // verify that the context has not been lost. |
| 180 bool Send(IPC::Message* msg); | 176 bool Send(IPC::Message* msg); |
| 181 | 177 |
| 182 // Message handlers: | 178 // Message handlers: |
| 183 void OnUpdateState(const gpu::CommandBuffer::State& state); | 179 void OnUpdateState(const gpu::CommandBuffer::State& state); |
| 184 void OnDestroyed(gpu::error::ContextLostReason reason, | 180 void OnDestroyed(gpu::error::ContextLostReason reason, |
| 185 gpu::error::Error error); | 181 gpu::error::Error error); |
| 186 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); | 182 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); |
| 187 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); | |
| 188 void OnSignalSyncPointAck(uint32 id); | 183 void OnSignalSyncPointAck(uint32 id); |
| 189 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, | 184 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, |
| 190 gfx::SwapResult result); | 185 gfx::SwapResult result); |
| 191 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 186 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
| 192 base::TimeDelta interval); | 187 base::TimeDelta interval); |
| 193 | 188 |
| 194 // Try to read an updated copy of the state from shared memory. | 189 // Try to read an updated copy of the state from shared memory. |
| 195 void TryUpdateState(); | 190 void TryUpdateState(); |
| 196 | 191 |
| 197 // The shared memory area used to update state. | 192 // The shared memory area used to update state. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 212 // raw pointer is ok. | 207 // raw pointer is ok. |
| 213 GpuChannelHost* channel_; | 208 GpuChannelHost* channel_; |
| 214 const int32 route_id_; | 209 const int32 route_id_; |
| 215 const int32 stream_id_; | 210 const int32 stream_id_; |
| 216 uint32 flush_count_; | 211 uint32 flush_count_; |
| 217 int32 last_put_offset_; | 212 int32 last_put_offset_; |
| 218 int32 last_barrier_put_offset_; | 213 int32 last_barrier_put_offset_; |
| 219 | 214 |
| 220 base::Closure context_lost_callback_; | 215 base::Closure context_lost_callback_; |
| 221 | 216 |
| 222 MemoryAllocationChangedCallback memory_allocation_changed_callback_; | |
| 223 | |
| 224 GpuConsoleMessageCallback console_message_callback_; | 217 GpuConsoleMessageCallback console_message_callback_; |
| 225 | 218 |
| 226 // Tasks to be invoked in SignalSyncPoint responses. | 219 // Tasks to be invoked in SignalSyncPoint responses. |
| 227 uint32 next_signal_id_; | 220 uint32 next_signal_id_; |
| 228 SignalTaskMap signal_tasks_; | 221 SignalTaskMap signal_tasks_; |
| 229 | 222 |
| 230 gpu::Capabilities capabilities_; | 223 gpu::Capabilities capabilities_; |
| 231 | 224 |
| 232 std::vector<ui::LatencyInfo> latency_info_; | 225 std::vector<ui::LatencyInfo> latency_info_; |
| 233 | 226 |
| 234 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 227 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
| 235 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 228 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
| 236 | 229 |
| 237 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 230 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
| 238 }; | 231 }; |
| 239 | 232 |
| 240 } // namespace content | 233 } // namespace content |
| 241 | 234 |
| 242 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 235 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
| OLD | NEW |