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 GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <queue> | 11 #include <queue> |
11 | 12 |
12 #include "base/atomic_ref_count.h" | 13 #include "base/atomic_ref_count.h" |
13 #include "base/atomicops.h" | 14 #include "base/atomicops.h" |
14 #include "base/callback.h" | 15 #include "base/callback.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
17 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
18 #include "base/memory/scoped_ptr.h" | |
19 #include "base/memory/shared_memory.h" | 19 #include "base/memory/shared_memory.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 21 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
22 #include "gpu/command_buffer/service/cmd_parser.h" | 22 #include "gpu/command_buffer/service/cmd_parser.h" |
23 #include "gpu/command_buffer/service/command_buffer_service.h" | 23 #include "gpu/command_buffer/service/command_buffer_service.h" |
24 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 24 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
25 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
26 | 26 |
27 namespace gpu { | 27 namespace gpu { |
28 | 28 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 AsyncAPIInterface* handler_; | 113 AsyncAPIInterface* handler_; |
114 | 114 |
115 // Does not own decoder. TODO(apatrick): The CommandExecutor shouldn't need a | 115 // Does not own decoder. TODO(apatrick): The CommandExecutor shouldn't need a |
116 // pointer to the decoder, it is only used to initialize the CommandParser, | 116 // pointer to the decoder, it is only used to initialize the CommandParser, |
117 // which could be an argument to the constructor, and to determine the | 117 // which could be an argument to the constructor, and to determine the |
118 // reason for context lost. | 118 // reason for context lost. |
119 gles2::GLES2Decoder* decoder_; | 119 gles2::GLES2Decoder* decoder_; |
120 | 120 |
121 // TODO(apatrick): The CommandExecutor currently creates and owns the parser. | 121 // TODO(apatrick): The CommandExecutor currently creates and owns the parser. |
122 // This should be an argument to the constructor. | 122 // This should be an argument to the constructor. |
123 scoped_ptr<CommandParser> parser_; | 123 std::unique_ptr<CommandParser> parser_; |
124 | 124 |
125 // Whether the scheduler is currently able to process more commands. | 125 // Whether the scheduler is currently able to process more commands. |
126 bool scheduled_; | 126 bool scheduled_; |
127 | 127 |
128 SchedulingChangedCallback scheduling_changed_callback_; | 128 SchedulingChangedCallback scheduling_changed_callback_; |
129 base::Closure descheduled_callback_; | 129 base::Closure descheduled_callback_; |
130 base::Closure command_processed_callback_; | 130 base::Closure command_processed_callback_; |
131 | 131 |
132 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 132 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
133 scoped_refptr<PreemptionFlag> preemption_flag_; | 133 scoped_refptr<PreemptionFlag> preemption_flag_; |
134 bool was_preempted_; | 134 bool was_preempted_; |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); | 136 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); |
137 }; | 137 }; |
138 | 138 |
139 } // namespace gpu | 139 } // namespace gpu |
140 | 140 |
141 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ | 141 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ |
OLD | NEW |