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

Unified Diff: media/filters/skcanvas_video_renderer.h

Issue 445013002: media: Optimize HW Video to 2D Canvas copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't move SkCanvasVideoRenderer Created 6 years, 4 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: media/filters/skcanvas_video_renderer.h
diff --git a/media/filters/skcanvas_video_renderer.h b/media/filters/skcanvas_video_renderer.h
index 9e3622d79c531058aee068ae8bce1e3ccc8de2e8..963ed358eb0c71fe4774fee3ba7935bdbf2f16d2 100644
--- a/media/filters/skcanvas_video_renderer.h
+++ b/media/filters/skcanvas_video_renderer.h
@@ -10,8 +10,15 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/rect.h"
+class GrContext;
class SkCanvas;
+namespace gpu {
+namespace gles2 {
+class GLES2Interface;
+}
+}
+
namespace media {
class VideoFrame;
@@ -23,6 +30,10 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
SkCanvasVideoRenderer();
~SkCanvasVideoRenderer();
+ struct ContextProvider {
danakj 2014/08/07 14:07:31 Please use a different name for this, it's a bit c
dshwang 2014/08/07 15:10:43 Done. Now it's Context3DProvider. btw I intended t
danakj 2014/08/07 15:14:34 Oh I had no idea that existed too.. heh.
+ gpu::gles2::GLES2Interface* gl;
+ class GrContext* gr_context;
+ };
// Paints |video_frame| on |canvas|, scaling the result to fit dimensions
// specified by |dest_rect|.
//
@@ -30,13 +41,28 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
void Paint(media::VideoFrame* video_frame,
SkCanvas* canvas,
const gfx::RectF& dest_rect,
- uint8 alpha);
+ uint8 alpha,
+ ContextProvider* context_provider);
+
+ static void CopyVideoFrameToTexture(gpu::gles2::GLES2Interface* gl,
+ media::VideoFrame* video_frame,
+ unsigned int texture,
+ unsigned int level,
+ unsigned int internal_format,
+ unsigned int type,
+ bool premultiply_alpha,
+ bool flip_y);
private:
+ void CleanUpTemporaryBuffers();
+
// An RGB bitmap and corresponding timestamp of the previously converted
// video frame data.
SkBitmap last_frame_;
base::TimeDelta last_frame_timestamp_;
+ // It's possible to be used by accelerated client and non-accelerated client.
+ SkBitmap accelerated_last_frame_;
+ base::TimeDelta accelerated_last_frame_timestamp_;
DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer);
};

Powered by Google App Engine
This is Rietveld 408576698