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

Unified Diff: content/public/browser/render_widget_host.h

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trim some trailing whitespace. Created 7 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: content/public/browser/render_widget_host.h
diff --git a/content/public/browser/render_widget_host.h b/content/public/browser/render_widget_host.h
index a0e8d8a70d3754cab16206f905e10bd48e5741dd..a6b2bd336fad663610487fe79c7e5b8dc4f3f880 100644
--- a/content/public/browser/render_widget_host.h
+++ b/content/public/browser/render_widget_host.h
@@ -28,6 +28,10 @@ namespace gfx {
class Rect;
}
+namespace media {
+class VideoFrame;
+}
+
namespace content {
class RenderProcessHost;
@@ -168,8 +172,8 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender {
// contents, but e.g. in the omnibox.
virtual void SetActive(bool active) = 0;
- // Copies the given subset of the backing store, and passes the result as a
- // bitmap to a callback.
+ // Copies the given subset of the backing store, and passes the result as an
+ // ARGB bitmap to a callback.
//
// If |src_rect| is empty, the whole contents is copied. If non empty
// |accelerated_dst_size| is given and accelerated compositing is active, the
@@ -195,6 +199,24 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender {
virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect,
CGContextRef target) = 0;
#endif
+ // Returns true if CopyFromBackingStoreToVideoFrame is possible on the current
scherkus (not reviewing) 2013/02/05 22:40:44 nit: add () to function names referenced in commen
ncarter (slow) 2013/02/06 23:54:44 Done.
+ // backing store. Depends on platform support and compositor state. Callers
+ // should check this before each call to CopyFromBackingStoreToVideoFrame().
scherkus (not reviewing) 2013/02/05 22:40:44 can we promote this "should" into a "must" and hav
ncarter (slow) 2013/02/06 23:54:44 Thanks for sharing your experience (which sounds h
scherkus (not reviewing) 2013/02/07 18:25:03 SGTM
+ virtual bool CanCopyToVideoFrame() const = 0;
+ // Copies a given subset of the backing store into a YV12 VideoFrame, and pass
scherkus (not reviewing) 2013/02/05 22:40:44 nit: blank line before comments to avoid walloftex
ncarter (slow) 2013/02/06 23:54:44 Done.
+ // it to the callback. The resulting VideoFrame will always be exactly
+ // |dst_size|. If |src_rect| does not match |dst_size|, the copied content
+ // will be scaled and letterboxed with black borders. Callbacks are permitted
+ // to take a refcount on the resulting VideoFrame for further processing on
+ // other threads.
+ //
+ // CopyFromBackingStoreToVideoFrame is not always possible. Callers should
+ // check the return value of CanCopyToVideoFrame(), and if false, fall back to
+ // a different method such as CopyFromBackingStore.
+ virtual void CopyFromBackingStoreToVideoFrame(
+ const gfx::Rect& src_rect,
+ const gfx::Size& dst_size,
+ const base::Callback<void(media::VideoFrame*)>& callback) = 0;
// Send a command to the renderer to turn on full accessibility.
virtual void EnableFullAccessibilityMode() = 0;

Powered by Google App Engine
This is Rietveld 408576698