| 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 UI_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
| 6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // Returns the main thread task runner this compositor uses. Users of the | 209 // Returns the main thread task runner this compositor uses. Users of the |
| 210 // compositor generally shouldn't use this. | 210 // compositor generally shouldn't use this. |
| 211 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 211 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
| 212 return task_runner_; | 212 return task_runner_; |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Compositor does not own observers. It is the responsibility of the | 215 // Compositor does not own observers. It is the responsibility of the |
| 216 // observer to remove itself when it is done observing. | 216 // observer to remove itself when it is done observing. |
| 217 void AddObserver(CompositorObserver* observer); | 217 void AddObserver(CompositorObserver* observer); |
| 218 void RemoveObserver(CompositorObserver* observer); | 218 void RemoveObserver(CompositorObserver* observer); |
| 219 bool HasObserver(CompositorObserver* observer); | 219 bool HasObserver(const CompositorObserver* observer) const; |
| 220 | 220 |
| 221 void AddAnimationObserver(CompositorAnimationObserver* observer); | 221 void AddAnimationObserver(CompositorAnimationObserver* observer); |
| 222 void RemoveAnimationObserver(CompositorAnimationObserver* observer); | 222 void RemoveAnimationObserver(CompositorAnimationObserver* observer); |
| 223 bool HasAnimationObserver(CompositorAnimationObserver* observer); | 223 bool HasAnimationObserver(const CompositorAnimationObserver* observer) const; |
| 224 | 224 |
| 225 // Creates a compositor lock. Returns NULL if it is not possible to lock at | 225 // Creates a compositor lock. Returns NULL if it is not possible to lock at |
| 226 // this time (i.e. we're waiting to complete a previous unlock). | 226 // this time (i.e. we're waiting to complete a previous unlock). |
| 227 scoped_refptr<CompositorLock> GetCompositorLock(); | 227 scoped_refptr<CompositorLock> GetCompositorLock(); |
| 228 | 228 |
| 229 // Internal functions, called back by command-buffer contexts on swap buffer | 229 // Internal functions, called back by command-buffer contexts on swap buffer |
| 230 // events. | 230 // events. |
| 231 | 231 |
| 232 // Signals swap has been posted. | 232 // Signals swap has been posted. |
| 233 void OnSwapBuffersPosted(); | 233 void OnSwapBuffersPosted(); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 LayerAnimatorCollection layer_animator_collection_; | 340 LayerAnimatorCollection layer_animator_collection_; |
| 341 | 341 |
| 342 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 342 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 343 | 343 |
| 344 DISALLOW_COPY_AND_ASSIGN(Compositor); | 344 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 345 }; | 345 }; |
| 346 | 346 |
| 347 } // namespace ui | 347 } // namespace ui |
| 348 | 348 |
| 349 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 349 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |