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

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

Issue 17971002: Make RenderWidgetHostViewAura::CopyFromCompositingSurface readback layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tabcapture-aura: SpellingIsHardLetsGoShopping Created 7 years, 6 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 849ffc2cd6d83dbb055f0a8988a652ffb86a6a4c..ae0e7401d47b2ec799ad33603e0396a95b95512d 100644
--- a/content/common/gpu/client/gl_helper.h
+++ b/content/common/gpu/client/gl_helper.h
@@ -17,6 +17,10 @@ class Rect;
class Size;
}
+namespace gpu {
+struct Mailbox;
+}
+
namespace media {
class VideoFrame;
};
@@ -225,6 +229,24 @@ class CONTENT_EXPORT GLHelper {
unsigned char* out,
const base::Callback<void(bool)>& callback);
+ // Copies the block of pixels specified with |src_subrect| from |src_mailbox|,
+ // scales it to |dst_size|, and writes it into |out|.
+ // |src_size| is the size of |src_mailbox|. 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.
+ // Note that the texture bound to src_mailbox will have the min/mag filter set
+ // to GL_LINEAR and wrap_s/t set to CLAMP_TO_EDGE in this call. src_mailbox is
+ // assumed to be GL_TEXTURE_2D.
+ void CropScaleReadbackAndCleanMailbox(
+ const gpu::Mailbox& src_mailbox,
+ uint32 sync_point,
+ 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
@@ -265,6 +287,11 @@ class CONTENT_EXPORT GLHelper {
// Simply creates a texture.
WebKit::WebGLId CreateTexture();
+ // Creates a texture and consumes a mailbox into it. Returns 0 on failure.
+ // Note the mailbox is assumed to be GL_TEXTURE_2D.
+ WebKit::WebGLId ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
+ uint32 sync_point);
+
// Resizes the texture's size to |size|.
void ResizeTexture(WebKit::WebGLId texture, const gfx::Size& size);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_browsertest.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698