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> |
11 | 11 |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/time/time.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "content/common/gpu/gpu_memory_manager.h" | 16 #include "content/common/gpu/gpu_memory_manager.h" |
16 #include "content/common/gpu/gpu_memory_manager_client.h" | 17 #include "content/common/gpu/gpu_memory_manager_client.h" |
17 #include "gpu/command_buffer/common/constants.h" | 18 #include "gpu/command_buffer/common/constants.h" |
18 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 19 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
19 #include "gpu/command_buffer/service/command_buffer_service.h" | 20 #include "gpu/command_buffer/service/command_buffer_service.h" |
20 #include "gpu/command_buffer/service/context_group.h" | 21 #include "gpu/command_buffer/service/context_group.h" |
21 #include "gpu/command_buffer/service/gpu_scheduler.h" | 22 #include "gpu/command_buffer/service/gpu_scheduler.h" |
22 #include "ipc/ipc_listener.h" | 23 #include "ipc/ipc_listener.h" |
23 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 void OnCreateStreamTexture( | 225 void OnCreateStreamTexture( |
225 uint32 texture_id, int32 stream_id, bool* succeeded); | 226 uint32 texture_id, int32 stream_id, bool* succeeded); |
226 | 227 |
227 void ReportState(); | 228 void ReportState(); |
228 | 229 |
229 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. | 230 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. |
230 void PutChanged(); | 231 void PutChanged(); |
231 | 232 |
232 // Poll the command buffer to execute work. | 233 // Poll the command buffer to execute work. |
233 void PollWork(); | 234 void PollWork(); |
| 235 void PerformWork(); |
234 | 236 |
235 // Whether this command buffer needs to be polled again in the future. | 237 // Schedule processing of delayed work. |
236 bool HasMoreWork(); | 238 void ScheduleDelayedWork(base::TimeDelta delay); |
237 | |
238 void ScheduleDelayedWork(int64 delay); | |
239 | 239 |
240 bool CheckContextLost(); | 240 bool CheckContextLost(); |
241 void CheckCompleteWaits(); | 241 void CheckCompleteWaits(); |
242 void PullTextureUpdates(uint32 sync_point); | 242 void PullTextureUpdates(uint32 sync_point); |
243 | 243 |
244 // The lifetime of objects of this class is managed by a GpuChannel. The | 244 // The lifetime of objects of this class is managed by a GpuChannel. The |
245 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they | 245 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they |
246 // are destroyed. So a raw pointer is safe. | 246 // are destroyed. So a raw pointer is safe. |
247 GpuChannel* channel_; | 247 GpuChannel* channel_; |
248 | 248 |
(...skipping 28 matching lines...) Expand all Loading... |
277 gpu::MemoryAllocation last_memory_allocation_; | 277 gpu::MemoryAllocation last_memory_allocation_; |
278 | 278 |
279 GpuWatchdog* watchdog_; | 279 GpuWatchdog* watchdog_; |
280 | 280 |
281 base::ObserverList<DestructionObserver> destruction_observers_; | 281 base::ObserverList<DestructionObserver> destruction_observers_; |
282 | 282 |
283 // A queue of sync points associated with this stub. | 283 // A queue of sync points associated with this stub. |
284 std::deque<uint32> sync_points_; | 284 std::deque<uint32> sync_points_; |
285 int sync_point_wait_count_; | 285 int sync_point_wait_count_; |
286 | 286 |
287 bool delayed_work_scheduled_; | 287 base::TimeTicks process_delayed_work_time_; |
288 uint64 previous_messages_processed_; | 288 uint64 previous_messages_processed_; |
289 base::TimeTicks last_idle_time_; | 289 base::TimeTicks last_idle_time_; |
290 | 290 |
291 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 291 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
292 | 292 |
293 LatencyInfoCallback latency_info_callback_; | 293 LatencyInfoCallback latency_info_callback_; |
294 | 294 |
295 GURL active_url_; | 295 GURL active_url_; |
296 size_t active_url_hash_; | 296 size_t active_url_hash_; |
297 | 297 |
298 size_t total_gpu_memory_; | 298 size_t total_gpu_memory_; |
299 scoped_ptr<WaitForCommandState> wait_for_token_; | 299 scoped_ptr<WaitForCommandState> wait_for_token_; |
300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
301 | 301 |
302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
303 }; | 303 }; |
304 | 304 |
305 } // namespace content | 305 } // namespace content |
306 | 306 |
307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |