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 CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 class CONTENT_EXPORT CompositorClient { | 13 class CONTENT_EXPORT CompositorClient { |
14 public: | 14 public: |
15 // Gives the client a chance to update the layer tree host before compositing. | 15 // Gives the client a chance to update the layer tree host before compositing. |
16 virtual void UpdateLayerTreeHost() {} | 16 virtual void UpdateLayerTreeHost() {} |
17 | 17 |
18 // The compositor has completed swapping a frame. | 18 // The compositor has completed swapping a frame. This is a subset of |
| 19 // DidSwapBuffers and corresponds only to frames where Compositor submits a |
| 20 // new frame. |
19 virtual void DidSwapFrame(int pending_frames) {} | 21 virtual void DidSwapFrame(int pending_frames) {} |
20 | 22 |
| 23 // This is called on all swap buffers, regardless of cause. |
| 24 virtual void DidSwapBuffers() {} |
| 25 |
21 protected: | 26 protected: |
22 CompositorClient() {} | 27 CompositorClient() {} |
23 virtual ~CompositorClient() {} | 28 virtual ~CompositorClient() {} |
24 | 29 |
25 private: | 30 private: |
26 DISALLOW_COPY_AND_ASSIGN(CompositorClient); | 31 DISALLOW_COPY_AND_ASSIGN(CompositorClient); |
27 }; | 32 }; |
28 | 33 |
29 } // namespace content | 34 } // namespace content |
30 | 35 |
31 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ | 36 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_CLIENT_H_ |
OLD | NEW |