OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ |
7 | 7 |
8 namespace cc { | 8 namespace cc { |
9 | 9 |
10 class LayerTreeHostSingleThreadClient { | 10 class LayerTreeHostSingleThreadClient { |
11 public: | 11 public: |
12 // Request that the client schedule a composite. | 12 // Request that the client schedule a composite. |
13 virtual void RequestScheduleComposite() {} | 13 virtual void RequestScheduleComposite() {} |
14 // Request that the client schedule a composite now, and calculate appropriate | 14 // Request that the client schedule a composite now, and calculate appropriate |
15 // delay for potential future frame. | 15 // delay for potential future frame. |
16 virtual void RequestScheduleAnimation() {} | 16 virtual void RequestScheduleAnimation() {} |
17 | 17 |
18 // Called whenever the compositor posts a SwapBuffers (either full or | 18 // Called whenever the compositor submits a CompositorFrame. Afterward, |
19 // partial). After DidPostSwapBuffers(), exactly one of | 19 // LayerTreeHostClient::DidReceiveCompositorFrameAck() will be called once the |
20 // DidReceiveCompositorFrameAck() or DidAbortSwapBuffers() will be called, | 20 // display compositor/ finishes processing the frame. So these functions can |
21 // thus | 21 // be used to keep track of pending submitted CompositorFrames for rate |
22 // these functions can be used to keep track of pending swap buffers calls for | 22 // limiting. |
23 // rate limiting. | 23 virtual void DidSubmitCompositorFrame() = 0; |
24 virtual void DidPostSwapBuffers() = 0; | 24 |
25 virtual void DidReceiveCompositorFrameAck() = 0; | 25 // Called when the active CompositorFrameSink is lost and needs to be |
26 virtual void DidAbortSwapBuffers() = 0; | 26 // replaced. This allows the embedder to schedule a composite which will |
| 27 // run the machinery to acquire a new CompositorFrameSink. |
| 28 virtual void DidLoseCompositorFrameSink() = 0; |
27 | 29 |
28 protected: | 30 protected: |
29 virtual ~LayerTreeHostSingleThreadClient() {} | 31 virtual ~LayerTreeHostSingleThreadClient() {} |
30 }; | 32 }; |
31 | 33 |
32 } // namespace cc | 34 } // namespace cc |
33 | 35 |
34 #endif // CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ | 36 #endif // CC_TREES_LAYER_TREE_HOST_SINGLE_THREAD_CLIENT_H_ |
OLD | NEW |