Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: trunk/src/content/public/browser/android/compositor.h

Issue 149653004: Revert 248827 "android: Migrate old content readback to use asyn..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/public/browser/android/compositor.h
===================================================================
--- trunk/src/content/public/browser/android/compositor.h (revision 248975)
+++ trunk/src/content/public/browser/android/compositor.h (working copy)
@@ -13,7 +13,7 @@
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
-class SkBitmap;
+#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
namespace cc {
class Layer;
@@ -72,21 +72,38 @@
// Composite immediately. Used in single-threaded mode.
virtual void Composite() = 0;
- // Generates a UIResource and returns a UIResourceId. |is_transient|
- // indicates whether or not to release the resource once the bitmap
- // has been uploaded. May return 0.
- virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap,
- bool is_transient) = 0;
+ // Generates a UIResource and returns a UIResourceId. May return 0.
+ virtual cc::UIResourceId GenerateUIResource(
+ const cc::UIResourceBitmap& bitmap) = 0;
- // Generates an ETC1 compressed UIResource. See above for |is_transient|.
- // May return 0.
- virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size,
- void* pixels,
- bool is_transient) = 0;
-
// Deletes a UIResource.
virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0;
+ // Generates an OpenGL texture and returns a texture handle. May return 0
+ // if the current context is lost.
+ virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0;
+
+ // Generates an OpenGL compressed texture and returns a texture handle. May
+ // return 0 if the current context is lost.
+ virtual blink::WebGLId GenerateCompressedTexture(gfx::Size& size,
+ int data_size,
+ void* data) = 0;
+
+ // Deletes an OpenGL texture.
+ virtual void DeleteTexture(blink::WebGLId texture_id) = 0;
+
+ // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is
+ // done. It is assumed that the texture size matches that of the bitmap.
+ virtual bool CopyTextureToBitmap(blink::WebGLId texture_id,
+ gfx::JavaBitmap& bitmap) = 0;
+
+ // Grabs a copy of |texture_id| and saves it into |bitmap|. No scaling is
+ // done. |src_rect| allows the caller to specify which rect of |texture_id|
+ // to copy to |bitmap|. It needs to match the size of |bitmap|. Returns
+ // true if the |texture_id| was copied into |bitmap|, false if not.
+ virtual bool CopyTextureToBitmap(blink::WebGLId texture_id,
+ const gfx::Rect& src_rect,
+ gfx::JavaBitmap& bitmap) = 0;
protected:
Compositor() {}
};

Powered by Google App Engine
This is Rietveld 408576698