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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.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_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // IPC::Listener implementation: 95 // IPC::Listener implementation:
96 bool OnMessageReceived(const IPC::Message& message) override; 96 bool OnMessageReceived(const IPC::Message& message) override;
97 97
98 // IPC::Sender implementation: 98 // IPC::Sender implementation:
99 bool Send(IPC::Message* msg) override; 99 bool Send(IPC::Message* msg) override;
100 100
101 // GpuMemoryManagerClient implementation: 101 // GpuMemoryManagerClient implementation:
102 gfx::Size GetSurfaceSize() const override; 102 gfx::Size GetSurfaceSize() const override;
103 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; 103 gpu::gles2::MemoryTracker* GetMemoryTracker() const override;
104 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override;
104 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; 105 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override;
105 bool GetTotalGpuMemory(uint64* bytes) override; 106 bool GetTotalGpuMemory(uint64* bytes) override;
106 107
107 // Whether this command buffer can currently handle IPC messages. 108 // Whether this command buffer can currently handle IPC messages.
108 bool IsScheduled(); 109 bool IsScheduled();
109 110
110 // Whether there are commands in the buffer that haven't been processed. 111 // Whether there are commands in the buffer that haven't been processed.
111 bool HasUnprocessedCommands(); 112 bool HasUnprocessedCommands();
112 113
113 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } 114 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void OnSignalQuery(uint32 query, uint32 id); 208 void OnSignalQuery(uint32 query, uint32 id);
208 209
209 void OnFenceSyncRelease(uint64_t release); 210 void OnFenceSyncRelease(uint64_t release);
210 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, 211 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id,
211 uint64_t command_buffer_id, 212 uint64_t command_buffer_id,
212 uint64_t release); 213 uint64_t release);
213 void OnWaitFenceSyncCompleted(gpu::CommandBufferNamespace namespace_id, 214 void OnWaitFenceSyncCompleted(gpu::CommandBufferNamespace namespace_id,
214 uint64_t command_buffer_id, 215 uint64_t command_buffer_id,
215 uint64_t release); 216 uint64_t release);
216 217
218 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback);
219
217 void OnCreateImage(int32 id, 220 void OnCreateImage(int32 id,
218 gfx::GpuMemoryBufferHandle handle, 221 gfx::GpuMemoryBufferHandle handle,
219 gfx::Size size, 222 gfx::Size size,
220 gfx::BufferFormat format, 223 gfx::BufferFormat format,
221 uint32 internalformat); 224 uint32 internalformat);
222 void OnDestroyImage(int32 id); 225 void OnDestroyImage(int32 id);
223 void OnCreateStreamTexture(uint32 texture_id, 226 void OnCreateStreamTexture(uint32 texture_id,
224 int32 stream_id, 227 int32 stream_id,
225 bool* succeeded); 228 bool* succeeded);
226 229
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 const int32 route_id_; 278 const int32 route_id_;
276 const bool offscreen_; 279 const bool offscreen_;
277 uint32 last_flush_count_; 280 uint32 last_flush_count_;
278 281
279 scoped_ptr<gpu::CommandBufferService> command_buffer_; 282 scoped_ptr<gpu::CommandBufferService> command_buffer_;
280 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; 283 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_;
281 scoped_ptr<gpu::GpuScheduler> scheduler_; 284 scoped_ptr<gpu::GpuScheduler> scheduler_;
282 scoped_ptr<gpu::SyncPointClient> sync_point_client_; 285 scoped_ptr<gpu::SyncPointClient> sync_point_client_;
283 scoped_refptr<gfx::GLSurface> surface_; 286 scoped_refptr<gfx::GLSurface> surface_;
284 287
288 scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_;
289 // The last memory allocation received from the GpuMemoryManager (used to
290 // elide redundant work).
291 bool last_memory_allocation_valid_;
292 gpu::MemoryAllocation last_memory_allocation_;
293
285 GpuWatchdog* watchdog_; 294 GpuWatchdog* watchdog_;
286 295
287 base::ObserverList<DestructionObserver> destruction_observers_; 296 base::ObserverList<DestructionObserver> destruction_observers_;
288 297
289 // A queue of sync points associated with this stub. 298 // A queue of sync points associated with this stub.
290 std::deque<uint32> sync_points_; 299 std::deque<uint32> sync_points_;
291 bool waiting_for_sync_point_; 300 bool waiting_for_sync_point_;
292 301
293 base::TimeTicks process_delayed_work_time_; 302 base::TimeTicks process_delayed_work_time_;
294 uint32_t previous_processed_num_; 303 uint32_t previous_processed_num_;
295 base::TimeTicks last_idle_time_; 304 base::TimeTicks last_idle_time_;
296 305
297 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; 306 scoped_refptr<gpu::PreemptionFlag> preemption_flag_;
298 307
299 LatencyInfoCallback latency_info_callback_; 308 LatencyInfoCallback latency_info_callback_;
300 309
301 GURL active_url_; 310 GURL active_url_;
302 size_t active_url_hash_; 311 size_t active_url_hash_;
303 312
304 size_t total_gpu_memory_; 313 size_t total_gpu_memory_;
305 scoped_ptr<WaitForCommandState> wait_for_token_; 314 scoped_ptr<WaitForCommandState> wait_for_token_;
306 scoped_ptr<WaitForCommandState> wait_for_get_offset_; 315 scoped_ptr<WaitForCommandState> wait_for_get_offset_;
307 316
308 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 317 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
309 }; 318 };
310 319
311 } // namespace content 320 } // namespace content
312 321
313 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 322 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698