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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 void AddDeletionObserver(DeletionObserver* observer); | 129 void AddDeletionObserver(DeletionObserver* observer); |
130 void RemoveDeletionObserver(DeletionObserver* observer); | 130 void RemoveDeletionObserver(DeletionObserver* observer); |
131 | 131 |
132 bool EnsureBackbuffer(); | 132 bool EnsureBackbuffer(); |
133 | 133 |
134 void SetOnConsoleMessageCallback( | 134 void SetOnConsoleMessageCallback( |
135 const GpuConsoleMessageCallback& callback); | 135 const GpuConsoleMessageCallback& callback); |
136 | 136 |
137 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); | 137 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
138 using SwapBuffersCompletionCallback = | 138 using SwapBuffersCompletionCallback = |
139 base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info)>; | 139 base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info, |
| 140 int result)>; |
140 void SetSwapBuffersCompletionCallback( | 141 void SetSwapBuffersCompletionCallback( |
141 const SwapBuffersCompletionCallback& callback); | 142 const SwapBuffersCompletionCallback& callback); |
142 | 143 |
143 using UpdateVSyncParametersCallback = | 144 using UpdateVSyncParametersCallback = |
144 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>; | 145 base::Callback<void(base::TimeTicks timebase, base::TimeDelta interval)>; |
145 void SetUpdateVSyncParametersCallback( | 146 void SetUpdateVSyncParametersCallback( |
146 const UpdateVSyncParametersCallback& callback); | 147 const UpdateVSyncParametersCallback& callback); |
147 | 148 |
148 // TODO(apatrick): this is a temporary optimization while skia is calling | 149 // TODO(apatrick): this is a temporary optimization while skia is calling |
149 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 | 150 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 |
(...skipping 22 matching lines...) Expand all Loading... |
172 // encapsulate the channel; all callers of this function must explicitly | 173 // encapsulate the channel; all callers of this function must explicitly |
173 // verify that the context has not been lost. | 174 // verify that the context has not been lost. |
174 bool Send(IPC::Message* msg); | 175 bool Send(IPC::Message* msg); |
175 | 176 |
176 // Message handlers: | 177 // Message handlers: |
177 void OnUpdateState(const gpu::CommandBuffer::State& state); | 178 void OnUpdateState(const gpu::CommandBuffer::State& state); |
178 void OnDestroyed(gpu::error::ContextLostReason reason); | 179 void OnDestroyed(gpu::error::ContextLostReason reason); |
179 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); | 180 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); |
180 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); | 181 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); |
181 void OnSignalSyncPointAck(uint32 id); | 182 void OnSignalSyncPointAck(uint32 id); |
182 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info); | 183 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, |
| 184 int32 result); |
183 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 185 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
184 base::TimeDelta interval); | 186 base::TimeDelta interval); |
185 | 187 |
186 // Try to read an updated copy of the state from shared memory. | 188 // Try to read an updated copy of the state from shared memory. |
187 void TryUpdateState(); | 189 void TryUpdateState(); |
188 | 190 |
189 // The shared memory area used to update state. | 191 // The shared memory area used to update state. |
190 gpu::CommandBufferSharedState* shared_state() const; | 192 gpu::CommandBufferSharedState* shared_state() const; |
191 | 193 |
192 base::Lock* lock_; | 194 base::Lock* lock_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 229 |
228 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 230 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
229 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 231 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
230 | 232 |
231 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 233 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
232 }; | 234 }; |
233 | 235 |
234 } // namespace content | 236 } // namespace content |
235 | 237 |
236 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 238 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |