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

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

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

Powered by Google App Engine
This is Rietveld 408576698