| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual void SetSurface(jobject surface) = 0; | 62 virtual void SetSurface(jobject surface) = 0; |
| 63 | 63 |
| 64 // Tells the view tree to assume a transparent background when rendering. | 64 // Tells the view tree to assume a transparent background when rendering. |
| 65 virtual void SetHasTransparentBackground(bool flag) = 0; | 65 virtual void SetHasTransparentBackground(bool flag) = 0; |
| 66 | 66 |
| 67 // Attempts to composite and read back the result into the provided buffer. | 67 // Attempts to composite and read back the result into the provided buffer. |
| 68 // The buffer must be at least window width * height * 4 (RGBA) bytes large. | 68 // The buffer must be at least window width * height * 4 (RGBA) bytes large. |
| 69 // The buffer is not modified if false is returned. | 69 // The buffer is not modified if false is returned. |
| 70 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; | 70 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; |
| 71 | 71 |
| 72 // Composite immediately. Used in single-threaded mode. | |
| 73 virtual void Composite() = 0; | |
| 74 | |
| 75 // Generates a UIResource and returns a UIResourceId. |is_transient| | 72 // Generates a UIResource and returns a UIResourceId. |is_transient| |
| 76 // indicates whether or not to release the resource once the bitmap | 73 // indicates whether or not to release the resource once the bitmap |
| 77 // has been uploaded. May return 0. | 74 // has been uploaded. May return 0. |
| 78 virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap, | 75 virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap, |
| 79 bool is_transient) = 0; | 76 bool is_transient) = 0; |
| 80 | 77 |
| 81 // Generates an ETC1 compressed UIResource. See above for |is_transient|. | 78 // Generates an ETC1 compressed UIResource. See above for |is_transient|. |
| 82 // May return 0. | 79 // May return 0. |
| 83 virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size, | 80 virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size, |
| 84 void* pixels, | 81 void* pixels, |
| 85 bool is_transient) = 0; | 82 bool is_transient) = 0; |
| 86 | 83 |
| 87 // Deletes a UIResource. | 84 // Deletes a UIResource. |
| 88 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; | 85 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; |
| 89 | 86 |
| 90 protected: | 87 protected: |
| 91 Compositor() {} | 88 Compositor() {} |
| 92 }; | 89 }; |
| 93 | 90 |
| 94 } // namespace content | 91 } // namespace content |
| 95 | 92 |
| 96 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 93 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |