| 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_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/atomic_ref_count.h" | 10 #include "base/atomic_ref_count.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // reason for context lost. | 119 // reason for context lost. |
| 120 gles2::GLES2Decoder* decoder_; | 120 gles2::GLES2Decoder* decoder_; |
| 121 | 121 |
| 122 // TODO(apatrick): The GpuScheduler currently creates and owns the parser. | 122 // TODO(apatrick): The GpuScheduler currently creates and owns the parser. |
| 123 // This should be an argument to the constructor. | 123 // This should be an argument to the constructor. |
| 124 scoped_ptr<CommandParser> parser_; | 124 scoped_ptr<CommandParser> parser_; |
| 125 | 125 |
| 126 // Greater than zero if this is waiting to be rescheduled before continuing. | 126 // Greater than zero if this is waiting to be rescheduled before continuing. |
| 127 int unscheduled_count_; | 127 int unscheduled_count_; |
| 128 | 128 |
| 129 // The number of times this scheduler has been artificially rescheduled on | |
| 130 // account of a timeout. | |
| 131 int rescheduled_count_; | |
| 132 | |
| 133 SchedulingChangedCallback scheduling_changed_callback_; | 129 SchedulingChangedCallback scheduling_changed_callback_; |
| 134 base::Closure descheduled_callback_; | 130 base::Closure descheduled_callback_; |
| 135 base::Closure command_processed_callback_; | 131 base::Closure command_processed_callback_; |
| 136 | 132 |
| 137 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 133 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
| 138 scoped_refptr<PreemptionFlag> preemption_flag_; | 134 scoped_refptr<PreemptionFlag> preemption_flag_; |
| 139 bool was_preempted_; | 135 bool was_preempted_; |
| 140 | 136 |
| 141 // A factory for outstanding rescheduling tasks that is invalidated whenever | |
| 142 // the scheduler is rescheduled. | |
| 143 base::WeakPtrFactory<GpuScheduler> reschedule_task_factory_; | |
| 144 | |
| 145 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 137 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
| 146 }; | 138 }; |
| 147 | 139 |
| 148 } // namespace gpu | 140 } // namespace gpu |
| 149 | 141 |
| 150 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 142 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
| OLD | NEW |