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

Unified Diff: ui/surface/accelerated_surface_win.h

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix per wjia 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
« no previous file with comments | « ui/surface/accelerated_surface_transformer_win_unittest.cc ('k') | ui/surface/accelerated_surface_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/surface/accelerated_surface_win.h
diff --git a/ui/surface/accelerated_surface_win.h b/ui/surface/accelerated_surface_win.h
index 1af2482ab69d2b8911e0f4914853c64d27861c82..eebaf1a98caa3c6fbd54ae7da00216751eb883f5 100644
--- a/ui/surface/accelerated_surface_win.h
+++ b/ui/surface/accelerated_surface_win.h
@@ -12,6 +12,7 @@
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
+#include "base/time.h"
#include "base/win/scoped_comptr.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
@@ -23,6 +24,10 @@ namespace gfx {
class Rect;
}
+namespace media {
+class VideoFrame;
+}
+
class SURFACE_EXPORT AcceleratedPresenter
: public base::RefCountedThreadSafe<AcceleratedPresenter> {
public:
@@ -65,6 +70,10 @@ class SURFACE_EXPORT AcceleratedPresenter
void AsyncCopyTo(const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback);
+ void AsyncCopyToVideoFrame(
+ const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& target,
+ const base::Callback<void(bool)>& callback);
void Invalidate();
#if defined(USE_AURA)
@@ -92,9 +101,16 @@ class SURFACE_EXPORT AcceleratedPresenter
const gfx::Size& dst_size,
scoped_refptr<base::SingleThreadTaskRunner> callback_runner,
const base::Callback<void(bool, const SkBitmap&)>& callback);
- bool DoCopyTo(const gfx::Rect& src_subrect,
- const gfx::Size& dst_size,
- SkBitmap* bitmap);
+ void DoCopyToVideoFrameAndAcknowledge(
+ const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& target,
+ const scoped_refptr<base::SingleThreadTaskRunner>& callback_runner,
+ const base::Callback<void(bool)>& callback);
+ bool DoCopyToYUV(const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& frame);
+ bool DoCopyToARGB(const gfx::Rect& src_subrect,
+ const gfx::Size& dst_size,
+ SkBitmap* bitmap);
void PresentWithGDI(HDC dc);
gfx::Size GetWindowSize();
@@ -165,15 +181,19 @@ class SURFACE_EXPORT AcceleratedSurface {
// Synchronously present a frame with no acknowledgement.
void Present(HDC dc);
- // Copies the surface data to |buf|. The copied region is specified with
- // |src_subrect| and the image data is transformed so that it fits in
- // |dst_size|.
- // Caller must ensure that |buf| is allocated with the size no less than
- // |4 * dst_size.width() * dst_size.height()| bytes.
+ // Transfer the contents of the surface to an SkBitmap, and invoke a callback
+ // with the result.
void AsyncCopyTo(const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback);
+ // Transfer the contents of the surface to an already-allocated YV12
+ // VideoFrame, and invoke a callback to indicate success or failure.
+ void AsyncCopyToVideoFrame(
+ const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& target,
+ const base::Callback<void(bool)>& callback);
+
// Temporarily release resources until a new surface is asynchronously
// presented. Present will not be able to represent the last surface after
// calling this and will return false.
« no previous file with comments | « ui/surface/accelerated_surface_transformer_win_unittest.cc ('k') | ui/surface/accelerated_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698