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

Unified Diff: media/filters/skcanvas_video_renderer.h

Issue 512733003: Do YUV conversion on the GPU when copying video frames into a GPU-accelerated canvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « media/DEPS ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/skcanvas_video_renderer.h
diff --git a/media/filters/skcanvas_video_renderer.h b/media/filters/skcanvas_video_renderer.h
index 3d1f4da56f76ef31b546b581bd1c85ca5ecdb2ee..131859c8756f47d38adeba402fbd2cbbe7470b71 100644
--- a/media/filters/skcanvas_video_renderer.h
+++ b/media/filters/skcanvas_video_renderer.h
@@ -13,6 +13,7 @@
#include "ui/gfx/rect.h"
class SkCanvas;
+class GrContext;
namespace media {
@@ -40,11 +41,27 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
void Copy(media::VideoFrame* video_frame, SkCanvas* canvas);
private:
+ // Special paint routine that uses a hardware-accelerated canvas to do YUV
+ // conversion.
+ bool HardwarePaint(media::VideoFrame* video_frame,
+ GrContext* gr,
+ const SkRect& dest_rect,
+ SkXfermode::Mode mode,
+ VideoRotation video_rotation);
+
// An RGB bitmap and corresponding timestamp of the previously converted
// video frame data.
SkBitmap last_frame_;
base::TimeDelta last_frame_timestamp_;
+ // These never actually allocate pixels, but wrap our yuv planes so that we
+ // can use them for hardware yuv conversion.
+ SkBitmap yuv_planes_[3];
+
+ // We store a separate timestamp for |yuv_planes_|'s contents, as they can get
+ // cached separately on the GPU.
+ base::TimeDelta yuv_planes_timestamp_;
+
DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer);
};
« no previous file with comments | « media/DEPS ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698