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/atomicops.h" | 10 #include "base/atomicops.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual int32 GetGetOffset() OVERRIDE; | 90 virtual int32 GetGetOffset() OVERRIDE; |
91 | 91 |
92 void SetCommandProcessedCallback(const base::Closure& callback); | 92 void SetCommandProcessedCallback(const base::Closure& callback); |
93 | 93 |
94 void DeferToFence(base::Closure task); | 94 void DeferToFence(base::Closure task); |
95 | 95 |
96 // Polls the fences, invoking callbacks that were waiting to be triggered | 96 // Polls the fences, invoking callbacks that were waiting to be triggered |
97 // by them and returns whether all fences were complete. | 97 // by them and returns whether all fences were complete. |
98 bool PollUnscheduleFences(); | 98 bool PollUnscheduleFences(); |
99 | 99 |
| 100 bool HasMoreIdleWork(); |
| 101 void PerformIdleWork(); |
| 102 |
100 CommandParser* parser() const { | 103 CommandParser* parser() const { |
101 return parser_.get(); | 104 return parser_.get(); |
102 } | 105 } |
103 | 106 |
104 bool IsPreempted(); | 107 bool IsPreempted(); |
105 | 108 |
106 private: | 109 private: |
107 // Artificially reschedule if the scheduler is still unscheduled after a | 110 // Artificially reschedule if the scheduler is still unscheduled after a |
108 // timeout. | 111 // timeout. |
109 void RescheduleTimeOut(); | 112 void RescheduleTimeOut(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. | 158 // If non-NULL and |preemption_flag_->IsSet()|, exit PutChanged early. |
156 scoped_refptr<PreemptionFlag> preemption_flag_; | 159 scoped_refptr<PreemptionFlag> preemption_flag_; |
157 bool was_preempted_; | 160 bool was_preempted_; |
158 | 161 |
159 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); | 162 DISALLOW_COPY_AND_ASSIGN(GpuScheduler); |
160 }; | 163 }; |
161 | 164 |
162 } // namespace gpu | 165 } // namespace gpu |
163 | 166 |
164 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 167 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |