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

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

Issue 628703005: Remove GpuHostMsg_FrameDrawn and replace with client channel swap ack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix cros/threaded Created 6 years, 2 months 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const MemoryAllocationChangedCallback& callback); 124 const MemoryAllocationChangedCallback& callback);
125 void AddDeletionObserver(DeletionObserver* observer); 125 void AddDeletionObserver(DeletionObserver* observer);
126 void RemoveDeletionObserver(DeletionObserver* observer); 126 void RemoveDeletionObserver(DeletionObserver* observer);
127 127
128 bool EnsureBackbuffer(); 128 bool EnsureBackbuffer();
129 129
130 void SetOnConsoleMessageCallback( 130 void SetOnConsoleMessageCallback(
131 const GpuConsoleMessageCallback& callback); 131 const GpuConsoleMessageCallback& callback);
132 132
133 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); 133 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
134 typedef base::Callback<void(const std::vector<ui::LatencyInfo>& latency_info)>
135 SwapBuffersCompletionCallback;
136 void SetSwapBuffersCompletionCallback(
137 const SwapBuffersCompletionCallback& callback);
134 138
135 // TODO(apatrick): this is a temporary optimization while skia is calling 139 // TODO(apatrick): this is a temporary optimization while skia is calling
136 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6 140 // ContentGLContext::MakeCurrent prior to every GL call. It saves returning 6
137 // ints redundantly when only the error is needed for the 141 // ints redundantly when only the error is needed for the
138 // CommandBufferProxyImpl implementation. 142 // CommandBufferProxyImpl implementation.
139 virtual gpu::error::Error GetLastError() override; 143 virtual gpu::error::Error GetLastError() override;
140 144
141 GpuChannelHost* channel() const { return channel_; } 145 GpuChannelHost* channel() const { return channel_; }
142 146
143 base::SharedMemoryHandle GetSharedStateHandle() const { 147 base::SharedMemoryHandle GetSharedStateHandle() const {
(...skipping 10 matching lines...) Expand all
154 // encapsulate the channel; all callers of this function must explicitly 158 // encapsulate the channel; all callers of this function must explicitly
155 // verify that the context has not been lost. 159 // verify that the context has not been lost.
156 bool Send(IPC::Message* msg); 160 bool Send(IPC::Message* msg);
157 161
158 // Message handlers: 162 // Message handlers:
159 void OnUpdateState(const gpu::CommandBuffer::State& state); 163 void OnUpdateState(const gpu::CommandBuffer::State& state);
160 void OnDestroyed(gpu::error::ContextLostReason reason); 164 void OnDestroyed(gpu::error::ContextLostReason reason);
161 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); 165 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message);
162 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation); 166 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation);
163 void OnSignalSyncPointAck(uint32 id); 167 void OnSignalSyncPointAck(uint32 id);
168 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info);
164 169
165 // Try to read an updated copy of the state from shared memory. 170 // Try to read an updated copy of the state from shared memory.
166 void TryUpdateState(); 171 void TryUpdateState();
167 172
168 // The shared memory area used to update state. 173 // The shared memory area used to update state.
169 gpu::CommandBufferSharedState* shared_state() const; 174 gpu::CommandBufferSharedState* shared_state() const;
170 175
171 // Unowned list of DeletionObservers. 176 // Unowned list of DeletionObservers.
172 ObserverList<DeletionObserver> deletion_observers_; 177 ObserverList<DeletionObserver> deletion_observers_;
173 178
(...skipping 20 matching lines...) Expand all
194 uint32 next_signal_id_; 199 uint32 next_signal_id_;
195 SignalTaskMap signal_tasks_; 200 SignalTaskMap signal_tasks_;
196 201
197 // Local cache of id to gpu memory buffer mapping. 202 // Local cache of id to gpu memory buffer mapping.
198 GpuMemoryBufferMap gpu_memory_buffers_; 203 GpuMemoryBufferMap gpu_memory_buffers_;
199 204
200 gpu::Capabilities capabilities_; 205 gpu::Capabilities capabilities_;
201 206
202 std::vector<ui::LatencyInfo> latency_info_; 207 std::vector<ui::LatencyInfo> latency_info_;
203 208
209 SwapBuffersCompletionCallback swap_buffers_completion_callback_;
210
204 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 211 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
205 }; 212 };
206 213
207 } // namespace content 214 } // namespace content
208 215
209 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 216 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/common/gpu/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698