OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace gpu { | 33 namespace gpu { |
34 namespace gles2 { | 34 namespace gles2 { |
35 class ContextGroup; | 35 class ContextGroup; |
36 } | 36 } |
37 | 37 |
38 // This class processes commands in a command buffer. It is event driven and | 38 // This class processes commands in a command buffer. It is event driven and |
39 // posts tasks to the current message loop to do additional work. | 39 // posts tasks to the current message loop to do additional work. |
40 class GpuScheduler : public CommandBufferEngine { | 40 class GpuScheduler : public CommandBufferEngine { |
41 public: | 41 public: |
| 42 // Scheduler quantum: makes ProcessCommands continue until the specified time |
| 43 // has passed, or the command buffer yields or runs out of commands. |
| 44 static const int kMinimumSchedulerQuantumMicros = 2000; |
| 45 |
42 // If a group is not passed in one will be created. | 46 // If a group is not passed in one will be created. |
43 GpuScheduler(CommandBuffer* command_buffer, | 47 GpuScheduler(CommandBuffer* command_buffer, |
44 SurfaceManager* surface_manager, | 48 SurfaceManager* surface_manager, |
45 gles2::ContextGroup* group); | 49 gles2::ContextGroup* group); |
46 | 50 |
47 // This constructor is for unit tests. | 51 // This constructor is for unit tests. |
48 GpuScheduler(CommandBuffer* command_buffer, | 52 GpuScheduler(CommandBuffer* command_buffer, |
49 gles2::GLES2Decoder* decoder, | 53 gles2::GLES2Decoder* decoder, |
50 CommandParser* parser, | 54 CommandParser* parser, |
51 int commands_per_update); | 55 int commands_per_update); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 #endif | 186 #endif |
183 | 187 |
184 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; | 188 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; |
185 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 189 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
186 scoped_ptr<Callback0::Type> command_processed_callback_; | 190 scoped_ptr<Callback0::Type> command_processed_callback_; |
187 }; | 191 }; |
188 | 192 |
189 } // namespace gpu | 193 } // namespace gpu |
190 | 194 |
191 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 195 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |