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