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

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

Issue 1412923004: Revert of Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 bool IsFenceSyncRelease(uint64_t release) override; 128 bool IsFenceSyncRelease(uint64_t release) override;
129 bool IsFenceSyncFlushed(uint64_t release) override; 129 bool IsFenceSyncFlushed(uint64_t release) override;
130 bool IsFenceSyncFlushReceived(uint64_t release) override; 130 bool IsFenceSyncFlushReceived(uint64_t release) override;
131 void SignalSyncToken(const gpu::SyncToken& sync_token, 131 void SignalSyncToken(const gpu::SyncToken& sync_token,
132 const base::Closure& callback) override; 132 const base::Closure& callback) override;
133 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; 133 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override;
134 134
135 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox); 135 bool ProduceFrontBuffer(const gpu::Mailbox& mailbox);
136 void SetContextLostCallback(const base::Closure& callback); 136 void SetContextLostCallback(const base::Closure& callback);
137 137
138 typedef base::Callback<void(const gpu::MemoryAllocation&)>
139 MemoryAllocationChangedCallback;
140 void SetMemoryAllocationChangedCallback(
141 const MemoryAllocationChangedCallback& callback);
138 void AddDeletionObserver(DeletionObserver* observer); 142 void AddDeletionObserver(DeletionObserver* observer);
139 void RemoveDeletionObserver(DeletionObserver* observer); 143 void RemoveDeletionObserver(DeletionObserver* observer);
140 144
141 bool EnsureBackbuffer(); 145 bool EnsureBackbuffer();
142 146
143 void SetOnConsoleMessageCallback( 147 void SetOnConsoleMessageCallback(
144 const GpuConsoleMessageCallback& callback); 148 const GpuConsoleMessageCallback& callback);
145 149
146 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); 150 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info);
147 using SwapBuffersCompletionCallback = 151 using SwapBuffersCompletionCallback =
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // Send an IPC message over the GPU channel. This is private to fully 187 // Send an IPC message over the GPU channel. This is private to fully
184 // encapsulate the channel; all callers of this function must explicitly 188 // encapsulate the channel; all callers of this function must explicitly
185 // verify that the context has not been lost. 189 // verify that the context has not been lost.
186 bool Send(IPC::Message* msg); 190 bool Send(IPC::Message* msg);
187 191
188 // Message handlers: 192 // Message handlers:
189 void OnUpdateState(const gpu::CommandBuffer::State& state); 193 void OnUpdateState(const gpu::CommandBuffer::State& state);
190 void OnDestroyed(gpu::error::ContextLostReason reason, 194 void OnDestroyed(gpu::error::ContextLostReason reason,
191 gpu::error::Error error); 195 gpu::error::Error error);
192 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message); 196 void OnConsoleMessage(const GPUCommandBufferConsoleMessage& message);
197 void OnSetMemoryAllocation(const gpu::MemoryAllocation& allocation);
193 void OnSignalAck(uint32 id); 198 void OnSignalAck(uint32 id);
194 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info, 199 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info,
195 gfx::SwapResult result); 200 gfx::SwapResult result);
196 void OnUpdateVSyncParameters(base::TimeTicks timebase, 201 void OnUpdateVSyncParameters(base::TimeTicks timebase,
197 base::TimeDelta interval); 202 base::TimeDelta interval);
198 203
199 // Try to read an updated copy of the state from shared memory. 204 // Try to read an updated copy of the state from shared memory.
200 void TryUpdateState(); 205 void TryUpdateState();
201 206
202 // Updates the highest verified release fence sync. 207 // Updates the highest verified release fence sync.
(...skipping 30 matching lines...) Expand all
233 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_; 238 std::queue<std::pair<uint64_t, uint32_t>> flushed_release_flush_id_;
234 239
235 // Last flushed fence sync release, same as last item in queue if not empty. 240 // Last flushed fence sync release, same as last item in queue if not empty.
236 uint64_t flushed_fence_sync_release_; 241 uint64_t flushed_fence_sync_release_;
237 242
238 // Last verified fence sync. 243 // Last verified fence sync.
239 uint64_t verified_fence_sync_release_; 244 uint64_t verified_fence_sync_release_;
240 245
241 base::Closure context_lost_callback_; 246 base::Closure context_lost_callback_;
242 247
248 MemoryAllocationChangedCallback memory_allocation_changed_callback_;
249
243 GpuConsoleMessageCallback console_message_callback_; 250 GpuConsoleMessageCallback console_message_callback_;
244 251
245 // Tasks to be invoked in SignalSyncPoint responses. 252 // Tasks to be invoked in SignalSyncPoint responses.
246 uint32 next_signal_id_; 253 uint32 next_signal_id_;
247 SignalTaskMap signal_tasks_; 254 SignalTaskMap signal_tasks_;
248 255
249 gpu::Capabilities capabilities_; 256 gpu::Capabilities capabilities_;
250 257
251 std::vector<ui::LatencyInfo> latency_info_; 258 std::vector<ui::LatencyInfo> latency_info_;
252 259
253 SwapBuffersCompletionCallback swap_buffers_completion_callback_; 260 SwapBuffersCompletionCallback swap_buffers_completion_callback_;
254 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; 261 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_;
255 262
256 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); 263 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl);
257 }; 264 };
258 265
259 } // namespace content 266 } // namespace content
260 267
261 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ 268 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698