OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const std::vector<int32>& attribs, | 153 const std::vector<int32>& attribs, |
154 gles2::GLES2Decoder* parent_decoder, | 154 gles2::GLES2Decoder* parent_decoder, |
155 uint32 parent_texture_id); | 155 uint32 parent_texture_id); |
156 | 156 |
157 | 157 |
158 private: | 158 private: |
159 // Helper which causes a call to ProcessCommands to be scheduled later. | 159 // Helper which causes a call to ProcessCommands to be scheduled later. |
160 void ScheduleProcessCommands(); | 160 void ScheduleProcessCommands(); |
161 | 161 |
162 // Called via a callback just before we are supposed to call the | 162 // Called via a callback just before we are supposed to call the |
| 163 // user's resize callback. |
| 164 void WillResize(gfx::Size size); |
| 165 |
| 166 // Called via a callback just before we are supposed to call the |
163 // user's swap buffers callback. | 167 // user's swap buffers callback. |
164 void WillSwapBuffers(); | 168 void WillSwapBuffers(); |
165 void ProcessCommands(); | 169 void ProcessCommands(); |
166 | 170 |
167 // The GpuScheduler holds a weak reference to the CommandBuffer. The | 171 // The GpuScheduler holds a weak reference to the CommandBuffer. The |
168 // CommandBuffer owns the GpuScheduler and holds a strong reference to it | 172 // CommandBuffer owns the GpuScheduler and holds a strong reference to it |
169 // through the ProcessCommands callback. | 173 // through the ProcessCommands callback. |
170 CommandBuffer* command_buffer_; | 174 CommandBuffer* command_buffer_; |
171 | 175 |
172 int commands_per_update_; | 176 int commands_per_update_; |
173 | 177 |
174 scoped_ptr<gles2::GLES2Decoder> decoder_; | 178 scoped_ptr<gles2::GLES2Decoder> decoder_; |
175 scoped_ptr<CommandParser> parser_; | 179 scoped_ptr<CommandParser> parser_; |
176 | 180 |
177 // Greater than zero if this is waiting to be rescheduled before continuing. | 181 // Greater than zero if this is waiting to be rescheduled before continuing. |
178 int unscheduled_count_; | 182 int unscheduled_count_; |
179 | 183 |
180 scoped_ptr<Callback0::Type> scheduled_callback_; | 184 scoped_ptr<Callback0::Type> scheduled_callback_; |
181 | 185 |
182 #if defined(OS_MACOSX) | 186 #if defined(OS_MACOSX) |
183 scoped_ptr<AcceleratedSurface> surface_; | 187 scoped_ptr<AcceleratedSurface> surface_; |
184 uint64 swap_buffers_count_; | 188 uint64 swap_buffers_count_; |
185 uint64 acknowledged_swap_buffers_count_; | 189 uint64 acknowledged_swap_buffers_count_; |
186 #endif | 190 #endif |
187 | 191 |
188 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; | 192 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; |
| 193 scoped_ptr<Callback1<gfx::Size>::Type> wrapped_resize_callback_; |
189 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 194 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
190 scoped_ptr<Callback0::Type> command_processed_callback_; | 195 scoped_ptr<Callback0::Type> command_processed_callback_; |
191 }; | 196 }; |
192 | 197 |
193 } // namespace gpu | 198 } // namespace gpu |
194 | 199 |
195 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 200 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |