Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.h

Issue 781683005: Ozone: Avoid blocking in Swapbuffer Call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unintended changes. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 void SetOnConsoleMessageCallback( 132 void SetOnConsoleMessageCallback(
133 const GpuConsoleMessageCallback& callback); 133 const GpuConsoleMessageCallback& callback);
134 134
135 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); 135 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
136 typedef base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info)> 136 typedef base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info)>
137 SwapBuffersCompletionCallback; 137 SwapBuffersCompletionCallback;
138 void SetSwapBuffersCompletionCallback( 138 void SetSwapBuffersCompletionCallback(
139 const SwapBuffersCompletionCallback& callback); 139 const SwapBuffersCompletionCallback& callback);
140 140
141 typedef base::Callback<void()>
142 PageFlipCompletionCallback;
143 void SetPageFlipCompletionCallback(
144 const PageFlipCompletionCallback& callback);
145
141 // TODO(apatrick): this is a temporary optimization while skia is calling 146 // TODO(apatrick): this is a temporary optimization while skia is calling
142 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 147 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6
143 // ints redundantly when only the error is needed for the 148 // ints redundantly when only the error is needed for the
144 // CommandBufferProxyImpl implementation. 149 // CommandBufferProxyImpl implementation.
145 gpu::error::Error GetLastError() override; 150 gpu::error::Error GetLastError() override;
146 151
147 GpuChannelHost* channel() const { return channel_; } 152 GpuChannelHost* channel() const { return channel_; }
148 153
149 base::SharedMemoryHandle GetSharedStateHandle() const { 154 base::SharedMemoryHandle GetSharedStateHandle() const {
150 return shared_state_shm_->handle(); 155 return shared_state_shm_->handle();
(...skipping 10 matching lines...) Expand all
161 // verify that the context has not been lost. 166 // verify that the context has not been lost.
162 bool Send(IPC::Message* msg); 167 bool Send(IPC::Message* msg);
163 168
164 // Message handlers: 169 // Message handlers:
165 void OnUpdateState(const gpu::CommandBuffer::State& state); 170 void OnUpdateState(const gpu::CommandBuffer::State& state);
166 void OnDestroyed(gpu::error::ContextLostReason reason); 171 void OnDestroyed(gpu::error::ContextLostReason reason);
167 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); 172 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message);
168 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); 173 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation);
169 void OnSignalSyncPointAck(uint32 id); 174 void OnSignalSyncPointAck(uint32 id);
170 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info); 175 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info);
176 void OnPageFlipCompleted();
171 177
172 // Try to read an updated copy of the state from shared memory. 178 // Try to read an updated copy of the state from shared memory.
173 void TryUpdateState(); 179 void TryUpdateState();
174 180
175 // The shared memory area used to update state. 181 // The shared memory area used to update state.
176 gpu::CommandBufferSharedState* shared_state() const; 182 gpu::CommandBufferSharedState* shared_state() const;
177 183
178 // Unowned list of DeletionObservers. 184 // Unowned list of DeletionObservers.
179 ObserverList<DeletionObserver> deletion_observers_; 185 ObserverList<DeletionObserver> deletion_observers_;
180 186
(...skipping 21 matching lines...) Expand all
202 SignalTaskMap signal_tasks_; 208 SignalTaskMap signal_tasks_;
203 209
204 // Local cache of id to gpu memory buffer mapping. 210 // Local cache of id to gpu memory buffer mapping.
205 GpuMemoryBufferMap gpu_memory_buffers_; 211 GpuMemoryBufferMap gpu_memory_buffers_;
206 212
207 gpu::Capabilities capabilities_; 213 gpu::Capabilities capabilities_;
208 214
209 std::vector<ui::LatencyInfo> latency_info_; 215 std::vector<ui::LatencyInfo> latency_info_;
210 216
211 SwapBuffersCompletionCallback swap_buffers_completion_callback_; 217 SwapBuffersCompletionCallback swap_buffers_completion_callback_;
218 PageFlipCompletionCallback page_flip_completion_callback_;
212 219
213 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 220 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
214 }; 221 };
215 222
216 } // namespace content 223 } // namespace content
217 224
218 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 225 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698