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 "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Composite immediately. Used in single-threaded mode. | 69 // Composite immediately. Used in single-threaded mode. |
70 virtual void Composite() = 0; | 70 virtual void Composite() = 0; |
71 | 71 |
72 // Generates a UIResource and returns a UIResourceId. May return 0. | 72 // Generates a UIResource and returns a UIResourceId. May return 0. |
73 virtual cc::UIResourceId GenerateUIResource( | 73 virtual cc::UIResourceId GenerateUIResource( |
74 const cc::UIResourceBitmap& bitmap) = 0; | 74 const cc::UIResourceBitmap& bitmap) = 0; |
75 | 75 |
76 // Deletes a UIResource. | 76 // Deletes a UIResource. |
77 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; | 77 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; |
78 | 78 |
| 79 // Returns the size of a UIResource. |
| 80 virtual gfx::Size GetUIResourceSize(cc::UIResourceId id) const = 0; |
| 81 |
79 // Generates an OpenGL texture and returns a texture handle. May return 0 | 82 // Generates an OpenGL texture and returns a texture handle. May return 0 |
80 // if the current context is lost. | 83 // if the current context is lost. |
81 virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0; | 84 virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0; |
82 | 85 |
83 // Generates an OpenGL compressed texture and returns a texture handle. May | 86 // Generates an OpenGL compressed texture and returns a texture handle. May |
84 // return 0 if the current context is lost. | 87 // return 0 if the current context is lost. |
85 virtual blink::WebGLId GenerateCompressedTexture(gfx::Size& size, | 88 virtual blink::WebGLId GenerateCompressedTexture(gfx::Size& size, |
86 int data_size, | 89 int data_size, |
87 void* data) = 0; | 90 void* data) = 0; |
88 | 91 |
89 // Deletes an OpenGL texture. | 92 // Deletes an OpenGL texture. |
90 virtual void DeleteTexture(blink::WebGLId texture_id) = 0; | 93 virtual void DeleteTexture(blink::WebGLId texture_id) = 0; |
91 | 94 |
92 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is | 95 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is |
93 // done. It is assumed that the texture size matches that of the bitmap. | 96 // done. It is assumed that the texture size matches that of the bitmap. |
94 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, | 97 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
95 gfx::JavaBitmap& bitmap) = 0; | 98 gfx::JavaBitmap& bitmap) = 0; |
96 | 99 |
97 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is | 100 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is |
98 // done. |src_rect| allows the caller to specify which rect of |texture_id| | 101 // done. |src_rect| allows the caller to specify which rect of |texture_id| |
99 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns | 102 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns |
100 // true if the |texture_id| was copied into |bitmap|, false if not. | 103 // true if the |texture_id| was copied into |bitmap|, false if not. |
101 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, | 104 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
102 const gfx::Rect& src_rect, | 105 const gfx::Rect& src_rect, |
103 gfx::JavaBitmap& bitmap) = 0; | 106 gfx::JavaBitmap& bitmap) = 0; |
| 107 |
| 108 virtual cc::UIResourceId GetOverscrollEdgeId() const = 0; |
| 109 virtual cc::UIResourceId GetOverscrollGlowId() const = 0; |
| 110 |
104 protected: | 111 protected: |
105 Compositor() {} | 112 Compositor() {} |
106 }; | 113 }; |
107 | 114 |
108 } // namespace content | 115 } // namespace content |
109 | 116 |
110 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 117 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
OLD | NEW |