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 "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 | 12 |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 14 |
| 15 namespace gfx { |
| 16 class JavaBitmap; |
| 17 } |
| 18 |
13 namespace WebKit { | 19 namespace WebKit { |
14 class WebLayer; | 20 class WebLayer; |
15 } | 21 } |
16 | 22 |
17 namespace content { | 23 namespace content { |
18 | 24 |
19 // An interface to the browser-side compositor. | 25 // An interface to the browser-side compositor. |
20 class Compositor { | 26 class Compositor { |
21 public: | 27 public: |
22 class Client { | 28 class Client { |
(...skipping 21 matching lines...) Expand all Loading... |
44 virtual void SetWindowSurface(ANativeWindow* window) = 0; | 50 virtual void SetWindowSurface(ANativeWindow* window) = 0; |
45 | 51 |
46 // Attempts to composite and read back the result into the provided buffer. | 52 // Attempts to composite and read back the result into the provided buffer. |
47 // The buffer must be at least window width * height * 4 (RGBA) bytes large. | 53 // The buffer must be at least window width * height * 4 (RGBA) bytes large. |
48 // The buffer is not modified if false is returned. | 54 // The buffer is not modified if false is returned. |
49 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; | 55 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; |
50 | 56 |
51 // Composite immediately. Used in single-threaded mode. | 57 // Composite immediately. Used in single-threaded mode. |
52 virtual void Composite() = 0; | 58 virtual void Composite() = 0; |
53 | 59 |
| 60 // Generates an OpenGL texture and returns a texture handle. May return 0 |
| 61 // if the current context is lost. |
| 62 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0; |
| 63 |
| 64 // Generates an OpenGL compressed texture and returns a texture handle. May |
| 65 // return 0 if the current context is lost. |
| 66 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, |
| 67 int data_size, |
| 68 void* data) = 0; |
| 69 |
| 70 // Deletes an OpenGL texture. |
| 71 virtual void DeleteTexture(WebKit::WebGLId texture_id) = 0; |
| 72 |
54 protected: | 73 protected: |
55 Compositor() {} | 74 Compositor() {} |
56 }; | 75 }; |
57 | 76 |
58 } // namespace content | 77 } // namespace content |
59 | 78 |
60 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 79 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
OLD | NEW |