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 <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 void SetCommandProcessedCallback(Callback0::Type* callback); | 152 void SetCommandProcessedCallback(Callback0::Type* callback); |
153 | 153 |
154 // Sets a callback which is called after a Set/WaitLatch command is processed. | 154 // Sets a callback which is called after a Set/WaitLatch command is processed. |
155 // The bool parameter will be true for SetLatch, and false for a WaitLatch | 155 // The bool parameter will be true for SetLatch, and false for a WaitLatch |
156 // that is blocked. An unblocked WaitLatch will not trigger a callback. | 156 // that is blocked. An unblocked WaitLatch will not trigger a callback. |
157 void SetLatchCallback(const base::Callback<void(bool)>& callback) { | 157 void SetLatchCallback(const base::Callback<void(bool)>& callback) { |
158 decoder_->SetLatchCallback(callback); | 158 decoder_->SetLatchCallback(callback); |
159 } | 159 } |
160 | 160 |
| 161 // Sets a callback which is called when set_token() is called, and passes the |
| 162 // just-set token to the callback. DCHECKs that no callback has previously |
| 163 // been registered for this notification. |
| 164 void SetTokenCallback(const base::Callback<void(int32)>& callback); |
| 165 |
161 // Get the GLES2Decoder associated with this scheduler. | 166 // Get the GLES2Decoder associated with this scheduler. |
162 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 167 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
163 | 168 |
164 protected: | 169 protected: |
165 // Perform common initialization. Takes ownership of GLSurface and GLContext. | 170 // Perform common initialization. Takes ownership of GLSurface and GLContext. |
166 bool InitializeCommon( | 171 bool InitializeCommon( |
167 const scoped_refptr<gfx::GLSurface>& surface, | 172 const scoped_refptr<gfx::GLSurface>& surface, |
168 const scoped_refptr<gfx::GLContext>& context, | 173 const scoped_refptr<gfx::GLContext>& context, |
169 const gfx::Size& size, | 174 const gfx::Size& size, |
170 const gles2::DisallowedExtensions& disallowed_extensions, | 175 const gles2::DisallowedExtensions& disallowed_extensions, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 std::map<uint64, scoped_refptr<AcceleratedSurface> > | 216 std::map<uint64, scoped_refptr<AcceleratedSurface> > |
212 surfaces_; | 217 surfaces_; |
213 scoped_refptr<AcceleratedSurface> back_surface_; | 218 scoped_refptr<AcceleratedSurface> back_surface_; |
214 scoped_refptr<AcceleratedSurface> front_surface_; | 219 scoped_refptr<AcceleratedSurface> front_surface_; |
215 #endif | 220 #endif |
216 | 221 |
217 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; | 222 ScopedRunnableMethodFactory<GpuScheduler> method_factory_; |
218 scoped_ptr<Callback1<gfx::Size>::Type> wrapped_resize_callback_; | 223 scoped_ptr<Callback1<gfx::Size>::Type> wrapped_resize_callback_; |
219 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 224 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
220 scoped_ptr<Callback0::Type> command_processed_callback_; | 225 scoped_ptr<Callback0::Type> command_processed_callback_; |
| 226 base::Callback<void(int32)> set_token_callback_; |
221 }; | 227 }; |
222 | 228 |
223 } // namespace gpu | 229 } // namespace gpu |
224 | 230 |
225 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ | 231 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_ |
OLD | NEW |