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 <memory> |
11 #include <queue> | 11 #include <queue> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/memory/weak_ptr.h" | |
17 #include "gpu/command_buffer/service/async_api_interface.h" | 16 #include "gpu/command_buffer/service/async_api_interface.h" |
18 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 17 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
19 #include "gpu/command_buffer/service/command_buffer_service.h" | 18 #include "gpu/command_buffer/service/command_buffer_service.h" |
20 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 19 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
21 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
22 | 21 |
23 namespace gpu { | 22 namespace gpu { |
24 | 23 |
25 // This class schedules commands that have been flushed. They are received via | 24 // This class schedules commands that have been flushed. They are received via |
26 // a command buffer and forwarded to a command handler. TODO(apatrick): This | 25 // a command buffer and forwarded to a command handler. TODO(apatrick): This |
27 // class should not know about the decoder. Do not add additional dependencies | 26 // class should not know about the decoder. Do not add additional dependencies |
28 // on it. | 27 // on it. |
29 class GPU_EXPORT CommandExecutor | 28 class GPU_EXPORT CommandExecutor |
30 : NON_EXPORTED_BASE(public CommandBufferEngine), | 29 : NON_EXPORTED_BASE(public CommandBufferEngine) { |
31 public base::SupportsWeakPtr<CommandExecutor> { | |
32 public: | 30 public: |
33 static const int kParseCommandsSlice = 20; | 31 static const int kParseCommandsSlice = 20; |
34 | 32 |
35 CommandExecutor(CommandBufferServiceBase* command_buffer, | 33 CommandExecutor(CommandBufferServiceBase* command_buffer, |
36 AsyncAPIInterface* handler, | 34 AsyncAPIInterface* handler, |
37 gles2::GLES2Decoder* decoder); | 35 gles2::GLES2Decoder* decoder); |
38 | 36 |
39 ~CommandExecutor() override; | 37 ~CommandExecutor() override; |
40 | 38 |
41 bool SetGetBuffer(int32_t transfer_buffer_id); | 39 bool SetGetBuffer(int32_t transfer_buffer_id); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // If this callback returns true, exit PutChanged early. | 103 // If this callback returns true, exit PutChanged early. |
106 PauseExecutionCallback pause_execution_callback_; | 104 PauseExecutionCallback pause_execution_callback_; |
107 bool paused_ = false; | 105 bool paused_ = false; |
108 | 106 |
109 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); | 107 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); |
110 }; | 108 }; |
111 | 109 |
112 } // namespace gpu | 110 } // namespace gpu |
113 | 111 |
114 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ | 112 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ |
OLD | NEW |