OLD | NEW |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // IPC::Listener implementation: | 91 // IPC::Listener implementation: |
92 bool OnMessageReceived(const IPC::Message& message) override; | 92 bool OnMessageReceived(const IPC::Message& message) override; |
93 | 93 |
94 // IPC::Sender implementation: | 94 // IPC::Sender implementation: |
95 bool Send(IPC::Message* msg) override; | 95 bool Send(IPC::Message* msg) override; |
96 | 96 |
97 // GpuMemoryManagerClient implementation: | 97 // GpuMemoryManagerClient implementation: |
98 gfx::Size GetSurfaceSize() const override; | 98 gfx::Size GetSurfaceSize() const override; |
99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; | 99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; |
100 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override; | |
101 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; | 100 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; |
102 bool GetTotalGpuMemory(uint64* bytes) override; | 101 bool GetTotalGpuMemory(uint64* bytes) override; |
103 | 102 |
104 // Whether this command buffer can currently handle IPC messages. | 103 // Whether this command buffer can currently handle IPC messages. |
105 bool IsScheduled(); | 104 bool IsScheduled(); |
106 | 105 |
107 // If the command buffer is pre-empted and cannot process commands. | 106 // If the command buffer is pre-empted and cannot process commands. |
108 bool IsPreempted() const { | 107 bool IsPreempted() const { |
109 return scheduler_.get() && scheduler_->IsPreempted(); | 108 return scheduler_.get() && scheduler_->IsPreempted(); |
110 } | 109 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 202 |
204 void OnEnsureBackbuffer(); | 203 void OnEnsureBackbuffer(); |
205 | 204 |
206 void OnRetireSyncPoint(uint32 sync_point); | 205 void OnRetireSyncPoint(uint32 sync_point); |
207 bool OnWaitSyncPoint(uint32 sync_point); | 206 bool OnWaitSyncPoint(uint32 sync_point); |
208 void OnWaitSyncPointCompleted(uint32 sync_point); | 207 void OnWaitSyncPointCompleted(uint32 sync_point); |
209 void OnSignalSyncPoint(uint32 sync_point, uint32 id); | 208 void OnSignalSyncPoint(uint32 sync_point, uint32 id); |
210 void OnSignalSyncPointAck(uint32 id); | 209 void OnSignalSyncPointAck(uint32 id); |
211 void OnSignalQuery(uint32 query, uint32 id); | 210 void OnSignalQuery(uint32 query, uint32 id); |
212 | 211 |
213 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); | |
214 | |
215 void OnCreateImage(int32 id, | 212 void OnCreateImage(int32 id, |
216 gfx::GpuMemoryBufferHandle handle, | 213 gfx::GpuMemoryBufferHandle handle, |
217 gfx::Size size, | 214 gfx::Size size, |
218 gfx::BufferFormat format, | 215 gfx::BufferFormat format, |
219 uint32 internalformat); | 216 uint32 internalformat); |
220 void OnDestroyImage(int32 id); | 217 void OnDestroyImage(int32 id); |
221 | 218 |
222 void OnCommandProcessed(); | 219 void OnCommandProcessed(); |
223 void OnParseError(); | 220 void OnParseError(); |
224 void OnCreateStreamTexture( | 221 void OnCreateStreamTexture( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 const int32 route_id_; | 260 const int32 route_id_; |
264 const int32 surface_id_; | 261 const int32 surface_id_; |
265 bool software_; | 262 bool software_; |
266 uint32 last_flush_count_; | 263 uint32 last_flush_count_; |
267 | 264 |
268 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 265 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
269 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 266 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
270 scoped_ptr<gpu::GpuScheduler> scheduler_; | 267 scoped_ptr<gpu::GpuScheduler> scheduler_; |
271 scoped_refptr<gfx::GLSurface> surface_; | 268 scoped_refptr<gfx::GLSurface> surface_; |
272 | 269 |
273 scoped_ptr<GpuMemoryManagerClientState> memory_manager_client_state_; | |
274 // The last memory allocation received from the GpuMemoryManager (used to | |
275 // elide redundant work). | |
276 bool last_memory_allocation_valid_; | |
277 gpu::MemoryAllocation last_memory_allocation_; | |
278 | |
279 GpuWatchdog* watchdog_; | 270 GpuWatchdog* watchdog_; |
280 | 271 |
281 base::ObserverList<DestructionObserver> destruction_observers_; | 272 base::ObserverList<DestructionObserver> destruction_observers_; |
282 | 273 |
283 // A queue of sync points associated with this stub. | 274 // A queue of sync points associated with this stub. |
284 std::deque<uint32> sync_points_; | 275 std::deque<uint32> sync_points_; |
285 int sync_point_wait_count_; | 276 int sync_point_wait_count_; |
286 | 277 |
287 bool delayed_work_scheduled_; | 278 bool delayed_work_scheduled_; |
288 uint64 previous_messages_processed_; | 279 uint64 previous_messages_processed_; |
289 base::TimeTicks last_idle_time_; | 280 base::TimeTicks last_idle_time_; |
290 | 281 |
291 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 282 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
292 | 283 |
293 LatencyInfoCallback latency_info_callback_; | 284 LatencyInfoCallback latency_info_callback_; |
294 | 285 |
295 GURL active_url_; | 286 GURL active_url_; |
296 size_t active_url_hash_; | 287 size_t active_url_hash_; |
297 | 288 |
298 size_t total_gpu_memory_; | 289 size_t total_gpu_memory_; |
299 scoped_ptr<WaitForCommandState> wait_for_token_; | 290 scoped_ptr<WaitForCommandState> wait_for_token_; |
300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 291 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
301 | 292 |
302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 293 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
303 }; | 294 }; |
304 | 295 |
305 } // namespace content | 296 } // namespace content |
306 | 297 |
307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 298 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |