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 CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // An interface to the browser-side compositor. | 26 // An interface to the browser-side compositor. |
27 class CONTENT_EXPORT Compositor { | 27 class CONTENT_EXPORT Compositor { |
28 public: | 28 public: |
29 class Client { | 29 class Client { |
30 public: | 30 public: |
31 // Tells the client that it should schedule a composite. | 31 // Tells the client that it should schedule a composite. |
32 virtual void ScheduleComposite() = 0; | 32 virtual void ScheduleComposite() = 0; |
33 | 33 |
34 // The compositor has completed swapping a frame. | 34 // The compositor has completed swapping a frame. |
35 virtual void OnSwapBuffersCompleted() {} | 35 virtual void OnSwapBuffersCompleted() {} |
| 36 |
| 37 // The compositor will eventually swap a frame. |
| 38 virtual void OnSwapBuffersPosted() {} |
36 }; | 39 }; |
37 | 40 |
38 virtual ~Compositor() {} | 41 virtual ~Compositor() {} |
39 | 42 |
40 // Performs the global initialization needed before any compositor | 43 // Performs the global initialization needed before any compositor |
41 // instance can be used. This should be called only once. | 44 // instance can be used. This should be called only once. |
42 static void Initialize(); | 45 static void Initialize(); |
43 | 46 |
44 enum CompositorFlags { | 47 enum CompositorFlags { |
45 // Creates a direct GL context on the thread that draws | 48 // Creates a direct GL context on the thread that draws |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 117 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
115 const gfx::Rect& src_rect, | 118 const gfx::Rect& src_rect, |
116 gfx::JavaBitmap& bitmap) = 0; | 119 gfx::JavaBitmap& bitmap) = 0; |
117 protected: | 120 protected: |
118 Compositor() {} | 121 Compositor() {} |
119 }; | 122 }; |
120 | 123 |
121 } // namespace content | 124 } // namespace content |
122 | 125 |
123 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 126 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
OLD | NEW |