| 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 "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // return 0 if the current context is lost. | 90 // return 0 if the current context is lost. |
| 91 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, | 91 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size, |
| 92 int data_size, | 92 int data_size, |
| 93 void* data) = 0; | 93 void* data) = 0; |
| 94 | 94 |
| 95 // Deletes an OpenGL texture. | 95 // Deletes an OpenGL texture. |
| 96 virtual void DeleteTexture(WebKit::WebGLId texture_id) = 0; | 96 virtual void DeleteTexture(WebKit::WebGLId texture_id) = 0; |
| 97 | 97 |
| 98 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is | 98 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is |
| 99 // done. It is assumed that the texture size matches that of the bitmap. | 99 // done. It is assumed that the texture size matches that of the bitmap. |
| 100 virtual void CopyTextureToBitmap(WebKit::WebGLId texture_id, | 100 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 101 gfx::JavaBitmap& bitmap) = 0; |
| 102 |
| 103 // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is |
| 104 // done. |src_rect| allows the caller to specify which rect of |texture_id| |
| 105 // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns |
| 106 // true if the |texture_id| was copied into |bitmap|, false if not. |
| 107 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 108 const gfx::Rect& src_rect, |
| 101 gfx::JavaBitmap& bitmap) = 0; | 109 gfx::JavaBitmap& bitmap) = 0; |
| 102 protected: | 110 protected: |
| 103 Compositor() {} | 111 Compositor() {} |
| 104 }; | 112 }; |
| 105 | 113 |
| 106 } // namespace content | 114 } // namespace content |
| 107 | 115 |
| 108 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 116 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |