| 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> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void SetCommandProcessedCallback(const base::Closure& callback); | 86 void SetCommandProcessedCallback(const base::Closure& callback); |
| 87 | 87 |
| 88 // Returns whether the scheduler needs to be polled again in the future to | 88 // Returns whether the scheduler needs to be polled again in the future to |
| 89 // process idle work. | 89 // process idle work. |
| 90 bool HasMoreIdleWork() const; | 90 bool HasMoreIdleWork() const; |
| 91 | 91 |
| 92 // Perform some idle work and return. HasMoreIdleWork() can be used to | 92 // Perform some idle work and return. HasMoreIdleWork() can be used to |
| 93 // determine if there's more idle work do be done after this has been called. | 93 // determine if there's more idle work do be done after this has been called. |
| 94 void PerformIdleWork(); | 94 void PerformIdleWork(); |
| 95 | 95 |
| 96 // Whether there is state that needs to be regularly polled. |
| 97 bool HasPollingWork() const; |
| 98 void PerformPollingWork(); |
| 99 |
| 96 CommandParser* parser() const { return parser_.get(); } | 100 CommandParser* parser() const { return parser_.get(); } |
| 97 | 101 |
| 98 private: | 102 private: |
| 99 bool IsPreempted(); | 103 bool IsPreempted(); |
| 100 | 104 |
| 101 // The CommandExecutor holds a weak reference to the CommandBuffer. The | 105 // The CommandExecutor holds a weak reference to the CommandBuffer. The |
| 102 // CommandBuffer owns the CommandExecutor and holds a strong reference to it | 106 // CommandBuffer owns the CommandExecutor and holds a strong reference to it |
| 103 // through the ProcessCommands callback. | 107 // through the ProcessCommands callback. |
| 104 CommandBufferServiceBase* command_buffer_; | 108 CommandBufferServiceBase* command_buffer_; |
| 105 | 109 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 124 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 128 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
| 125 scoped_refptr<PreemptionFlag> preemption_flag_; | 129 scoped_refptr<PreemptionFlag> preemption_flag_; |
| 126 bool was_preempted_; | 130 bool was_preempted_; |
| 127 | 131 |
| 128 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); | 132 DISALLOW_COPY_AND_ASSIGN(CommandExecutor); |
| 129 }; | 133 }; |
| 130 | 134 |
| 131 } // namespace gpu | 135 } // namespace gpu |
| 132 | 136 |
| 133 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ | 137 #endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_EXECUTOR_H_ |
| OLD | NEW |