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

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: Fix a verb tense parallelism problem in a comment. 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..e79f01270b3d0285e9d55c414c6d9beeba15dadf 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
@@ -196,6 +200,24 @@ class CONTENT_EXPORT RenderWidgetHost : public IPC::Sender {
CGContextRef target) = 0;
#endif
+ // Returns true if CopyFromBackingStoreToVideoFrame() is possible on the
+ // current backing store. Depends on platform support and compositor state.
+ virtual bool CanCopyToVideoFrame() const = 0;
+
+ // Copies a given subset of the backing store into a YV12 VideoFrame, and
+ // invokes a callback with a success/fail parameter. |target| must contain an
+ // allocated, YV12 video frame of the intended size. If |src_rect| does not
+ // match the |target|'s size, the copied content will be scaled and
+ // letterboxed with black borders. The copy may happen asynchronously.
+ //
+ // CopyFromBackingStoreToVideoFrame() is not always possible. Callers must
+ // 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 scoped_refptr<media::VideoFrame>& target,
+ const base::Callback<void(bool)>& 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