OLD | NEW |
1 // Copyright (c) 2012 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 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/shared_memory.h" | 14 #include "base/shared_memory.h" |
15 #include "gpu/command_buffer/common/command_buffer.h" | 15 #include "gpu/command_buffer/common/command_buffer.h" |
16 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 16 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
17 #include "gpu/command_buffer/service/cmd_parser.h" | 17 #include "gpu/command_buffer/service/cmd_parser.h" |
18 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 18 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
19 #include "gpu/gpu_export.h" | |
20 | 19 |
21 namespace gfx { | 20 namespace gfx { |
22 class GLFence; | 21 class GLFence; |
23 } | 22 } |
24 | 23 |
25 namespace gpu { | 24 namespace gpu { |
26 | 25 |
27 // This class schedules commands that have been flushed. They are received via | 26 // This class schedules commands that have been flushed. They are received via |
28 // a command buffer and forwarded to a command parser. TODO(apatrick): This | 27 // a command buffer and forwarded to a command parser. TODO(apatrick): This |
29 // class should not know about the decoder. Do not add additional dependencies | 28 // class should not know about the decoder. Do not add additional dependencies |
30 // on it. | 29 // on it. |
31 class GPU_EXPORT GpuScheduler | 30 class GpuScheduler |
32 : NON_EXPORTED_BASE(public CommandBufferEngine), | 31 : public CommandBufferEngine, |
33 public base::SupportsWeakPtr<GpuScheduler> { | 32 public base::SupportsWeakPtr<GpuScheduler> { |
34 public: | 33 public: |
35 GpuScheduler(CommandBuffer* command_buffer, | 34 GpuScheduler(CommandBuffer* command_buffer, |
36 AsyncAPIInterface* handler, | 35 AsyncAPIInterface* handler, |
37 gles2::GLES2Decoder* decoder); | 36 gles2::GLES2Decoder* decoder); |
38 | 37 |
39 virtual ~GpuScheduler(); | 38 virtual ~GpuScheduler(); |
40 | 39 |
41 void PutChanged(); | 40 void PutChanged(); |
42 | 41 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 121 |
123 base::Closure scheduled_callback_; | 122 base::Closure scheduled_callback_; |
124 base::Closure command_processed_callback_; | 123 base::Closure command_processed_callback_; |
125 | 124 |
126 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 125 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
127 }; | 126 }; |
128 | 127 |
129 } // namespace gpu | 128 } // namespace gpu |
130 | 129 |
131 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 130 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |