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

Side by Side Diff: media/filters/skcanvas_video_renderer.h

Issue 441303002: 2D Canvas doesn't blend video with the destination buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT. improve TODO comments 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_ 5 #ifndef MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_
6 #define MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_ 6 #define MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "media/base/media_export.h" 9 #include "media/base/media_export.h"
10 #include "media/base/video_rotation.h" 10 #include "media/base/video_rotation.h"
11 #include "third_party/skia/include/core/SkBitmap.h" 11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "third_party/skia/include/core/SkXfermode.h"
12 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
13 14
14 class SkCanvas; 15 class SkCanvas;
15 16
16 namespace media { 17 namespace media {
17 18
18 class VideoFrame; 19 class VideoFrame;
19 20
20 // Handles rendering of VideoFrames to SkCanvases, doing any necessary YUV 21 // Handles rendering of VideoFrames to SkCanvases, doing any necessary YUV
21 // conversion and caching of resulting RGB bitmaps. 22 // conversion and caching of resulting RGB bitmaps.
22 class MEDIA_EXPORT SkCanvasVideoRenderer { 23 class MEDIA_EXPORT SkCanvasVideoRenderer {
23 public: 24 public:
24 SkCanvasVideoRenderer(); 25 SkCanvasVideoRenderer();
25 ~SkCanvasVideoRenderer(); 26 ~SkCanvasVideoRenderer();
26 27
27 // Paints |video_frame| on |canvas|, scaling the result to fit dimensions 28 // Paints |video_frame| on |canvas|, scaling the result to fit dimensions
28 // specified by |dest_rect|. 29 // specified by |dest_rect|.
29 // 30 //
30 // Black will be painted on |canvas| if |video_frame| is null. 31 // Black will be painted on |canvas| if |video_frame| is null.
31 void Paint(media::VideoFrame* video_frame, 32 void Paint(media::VideoFrame* video_frame,
32 SkCanvas* canvas, 33 SkCanvas* canvas,
33 const gfx::RectF& dest_rect, 34 const gfx::RectF& dest_rect,
34 uint8 alpha, 35 uint8 alpha,
36 SkXfermode::Mode mode,
35 VideoRotation video_rotation); 37 VideoRotation video_rotation);
36 38
39 // Copy |video_frame| on |canvas|.
40 void Copy(media::VideoFrame* video_frame, SkCanvas* canvas);
41
37 private: 42 private:
38 // An RGB bitmap and corresponding timestamp of the previously converted 43 // An RGB bitmap and corresponding timestamp of the previously converted
39 // video frame data. 44 // video frame data.
40 SkBitmap last_frame_; 45 SkBitmap last_frame_;
41 base::TimeDelta last_frame_timestamp_; 46 base::TimeDelta last_frame_timestamp_;
42 47
43 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer); 48 DISALLOW_COPY_AND_ASSIGN(SkCanvasVideoRenderer);
44 }; 49 };
45 50
46 } // namespace media 51 } // namespace media
47 52
48 #endif // MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_ 53 #endif // MEDIA_FILTERS_SKCANVAS_VIDEO_RENDERER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698