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_OBSERVER_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_OBSERVER_H_ |
6 #define UI_COMPOSITOR_COMPOSITOR_OBSERVER_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_OBSERVER_H_ |
7 | 7 |
8 #include "ui/compositor/compositor_export.h" | 8 #include "ui/compositor/compositor_export.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 | 11 |
12 class Compositor; | 12 class Compositor; |
13 | 13 |
14 // A compositor observer is notified when compositing completes. | 14 // A compositor observer is notified when compositing completes. |
15 class COMPOSITOR_EXPORT CompositorObserver { | 15 class COMPOSITOR_EXPORT CompositorObserver { |
16 public: | 16 public: |
| 17 // A commit proxies information from the main thread to the compositor |
| 18 // thread. It typically happens when some state changes that will require a |
| 19 // composite. In the multi-threaded case, many commits may happen between |
| 20 // two successive composites. In the single-threaded, a single commit |
| 21 // between two composites (just before the composite as part of the |
| 22 // composite cycle). |
| 23 virtual void OnCompositingDidCommit(Compositor* compositor) = 0; |
| 24 |
17 // Called when compositing will start. | 25 // Called when compositing will start. |
18 virtual void OnCompositingWillStart(Compositor* compositor) = 0; | 26 virtual void OnCompositingWillStart(Compositor* compositor) = 0; |
19 | 27 |
20 // Called when compositing started: it has taken all the layer changes into | 28 // Called when compositing started: it has taken all the layer changes into |
21 // account and has issued the graphics commands. | 29 // account and has issued the graphics commands. |
22 virtual void OnCompositingStarted(Compositor* compositor) = 0; | 30 virtual void OnCompositingStarted(Compositor* compositor) = 0; |
23 | 31 |
24 // Called when compositing completes: the present to screen has completed. | 32 // Called when compositing completes: the present to screen has completed. |
25 virtual void OnCompositingEnded(Compositor* compositor) = 0; | 33 virtual void OnCompositingEnded(Compositor* compositor) = 0; |
26 | 34 |
27 // Called when compositing is aborted (e.g. lost graphics context). | 35 // Called when compositing is aborted (e.g. lost graphics context). |
28 virtual void OnCompositingAborted(Compositor* compositor) = 0; | 36 virtual void OnCompositingAborted(Compositor* compositor) = 0; |
29 | 37 |
30 protected: | 38 protected: |
31 virtual ~CompositorObserver() {} | 39 virtual ~CompositorObserver() {} |
32 }; | 40 }; |
33 | 41 |
34 } // namespace ui | 42 } // namespace ui |
35 | 43 |
36 #endif // UI_COMPOSITOR_COMPOSITOR_OBSERVER_H_ | 44 #endif // UI_COMPOSITOR_COMPOSITOR_OBSERVER_H_ |
OLD | NEW |