| 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" | |
| 10 #include "cc/resources/ui_resource_client.h" | |
| 11 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 14 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 15 | 13 |
| 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 14 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 17 | 15 |
| 18 namespace cc { | 16 namespace cc { |
| 19 class Layer; | 17 class Layer; |
| 20 } | 18 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // The buffer must be at least window width * height * 4 (RGBA) bytes large. | 77 // The buffer must be at least window width * height * 4 (RGBA) bytes large. |
| 80 // The buffer is not modified if false is returned. | 78 // The buffer is not modified if false is returned. |
| 81 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; | 79 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; |
| 82 | 80 |
| 83 // Invalidate the whole viewport. | 81 // Invalidate the whole viewport. |
| 84 virtual void SetNeedsRedraw() = 0; | 82 virtual void SetNeedsRedraw() = 0; |
| 85 | 83 |
| 86 // Composite immediately. Used in single-threaded mode. | 84 // Composite immediately. Used in single-threaded mode. |
| 87 virtual void Composite() = 0; | 85 virtual void Composite() = 0; |
| 88 | 86 |
| 89 // Generates a UIResource and returns a UIResourceId. May return 0. | |
| 90 virtual cc::UIResourceId GenerateUIResource( | |
| 91 const cc::UIResourceBitmap& bitmap) = 0; | |
| 92 | |
| 93 // Deletes a UIResource. | |
| 94 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; | |
| 95 | |
| 96 // Generates an OpenGL texture and returns a texture handle. May return 0 | 87 // Generates an OpenGL texture and returns a texture handle. May return 0 |
| 97 // if the current context is lost. | 88 // if the current context is lost. |
| 98 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0; | 89 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0; |
| 99 | 90 |
| 100 // Generates an OpenGL compressed texture and returns a texture handle. May | 91 // Generates an OpenGL compressed texture and returns a texture handle. May |
| 101 // return 0 if the current context is lost. | 92 // return 0 if the current context is lost. |
| 102 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, | 93 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, |
| 103 int data_size, | 94 int data_size, |
| 104 void* data) = 0; | 95 void* data) = 0; |
| 105 | 96 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 118 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 109 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 119 const gfx::Rect& src_rect, | 110 const gfx::Rect& src_rect, |
| 120 gfx::JavaBitmap& bitmap) = 0; | 111 gfx::JavaBitmap& bitmap) = 0; |
| 121 protected: | 112 protected: |
| 122 Compositor() {} | 113 Compositor() {} |
| 123 }; | 114 }; |
| 124 | 115 |
| 125 } // namespace content | 116 } // namespace content |
| 126 | 117 |
| 127 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 118 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |