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

Unified Diff: content/common/gpu/client/gl_helper.h

Issue 11234008: Enable texture readback support for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 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: content/common/gpu/client/gl_helper.h
diff --git a/content/common/gpu/client/gl_helper.h b/content/common/gpu/client/gl_helper.h
index 8157c9a96bed913ece6b6a2ceaa4ff35fc6c3f66..fd9f83a9cf047a49603cd9611d49d4e80105549a 100644
--- a/content/common/gpu/client/gl_helper.h
+++ b/content/common/gpu/client/gl_helper.h
@@ -30,19 +30,37 @@ class GLHelper {
// Copies the block of pixels specified with |src_subrect| from |src_texture|,
// scales it to |dst_size|, and writes it into |out|.
- // |src_size| is the size of |src_texture|. |callback| is invoked with the
- // copy result when the copy operation has completed.
- void CopyTextureTo(WebKit::WebGLId src_texture,
- const gfx::Size& src_size,
- const gfx::Rect& src_subrect,
- const gfx::Size& dst_size,
- unsigned char* out,
- const base::Callback<void(bool)>& callback);
+ // |src_size| is the size of |src_texture|. The result is of format GL_BGRA
+ // and is potentially flipped vertically to make it a correct image
+ // representation. |callback| is invoked with the copy result when the copy
+ // operation has completed.
+ void CropScaleReadbackAndCleanTexture(
+ WebKit::WebGLId src_texture,
+ const gfx::Size& src_size,
+ const gfx::Rect& src_subrect,
+ const gfx::Size& dst_size,
+ unsigned char* out,
+ const base::Callback<void(bool)>& callback);
+
+ // Copies the texture data out of |texture| into |out|. |size| is the
+ // size of the texture. No post processing is applied to the pixels. The
+ // texture is assumed to have a format of GL_RGBA with a pixel type of
+ // GL_UNSIGNED_BYTE. This is a blocking call that calls glReadPixels on this
+ // current context.
+ void ReadbackTextureSync(WebKit::WebGLId texture,
+ const gfx::Size& size,
+ unsigned char* out);
// Creates a copy of the specified texture. |size| is the size of the texture.
WebKit::WebGLId CopyTexture(WebKit::WebGLId texture,
const gfx::Size& size);
+ // Creates a scaled copy of the specified texture. |src_size| is the size of
+ // the texture and |dst_size| is the size of the resulting copy.
+ WebKit::WebGLId CopyAndScaleTexture(WebKit::WebGLId texture,
+ const gfx::Size& src_size,
+ const gfx::Size& dst_size);
+
// Returns the shader compiled from the source.
WebKit::WebGLId CompileShaderFromSource(const WebKit::WGC3Dchar* source,
WebKit::WGC3Denum type);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698