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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Set the output surface bounds. | 66 // Set the output surface bounds. |
67 virtual void SetWindowBounds(const gfx::Size& size) = 0; | 67 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
68 | 68 |
69 // Sets the window visibility. When becoming invisible, resources will get | 69 // Sets the window visibility. When becoming invisible, resources will get |
70 // freed and other calls into the compositor are not allowed until after | 70 // freed and other calls into the compositor are not allowed until after |
71 // having been made visible again. | 71 // having been made visible again. |
72 virtual void SetVisible(bool visible) = 0; | 72 virtual void SetVisible(bool visible) = 0; |
73 | 73 |
74 // Set the output surface handle which the compositor renders into. | 74 // Set the output surface handle which the compositor renders into. |
| 75 // DEPRECATED: Use SetSurface() which takes a Java Surface object. |
75 virtual void SetWindowSurface(ANativeWindow* window) = 0; | 76 virtual void SetWindowSurface(ANativeWindow* window) = 0; |
76 | 77 |
| 78 // Set the output surface which the compositor renders into. |
| 79 virtual void SetSurface(jobject surface) = 0; |
| 80 |
77 // Tells the view tree to assume a transparent background when rendering. | 81 // Tells the view tree to assume a transparent background when rendering. |
78 virtual void SetHasTransparentBackground(bool flag) = 0; | 82 virtual void SetHasTransparentBackground(bool flag) = 0; |
79 | 83 |
80 // Attempts to composite and read back the result into the provided buffer. | 84 // Attempts to composite and read back the result into the provided buffer. |
81 // The buffer must be at least window width * height * 4 (RGBA) bytes large. | 85 // The buffer must be at least window width * height * 4 (RGBA) bytes large. |
82 // The buffer is not modified if false is returned. | 86 // The buffer is not modified if false is returned. |
83 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; | 87 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; |
84 | 88 |
85 // Composite immediately. Used in single-threaded mode. | 89 // Composite immediately. Used in single-threaded mode. |
86 virtual void Composite() = 0; | 90 virtual void Composite() = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
110 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 114 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
111 const gfx::Rect& src_rect, | 115 const gfx::Rect& src_rect, |
112 gfx::JavaBitmap& bitmap) = 0; | 116 gfx::JavaBitmap& bitmap) = 0; |
113 protected: | 117 protected: |
114 Compositor() {} | 118 Compositor() {} |
115 }; | 119 }; |
116 | 120 |
117 } // namespace content | 121 } // namespace content |
118 | 122 |
119 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 123 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
OLD | NEW |