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

Unified Diff: media/base/video_frame.cc

Issue 388363002: Use SkSrc_Mode in SkCanvasVideoRenderer, to prevent transparent video frames from blending with reu… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: static_cast<SkColor> instead of (unsigned int) Created 6 years, 5 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/base/video_frame.h ('k') | media/base/video_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 74e6cae08d76d9c764a9d5590464edf35c17788a..f6b49e483d68e07bc2f3c436a9bf1fce4b654274 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -372,6 +372,19 @@ scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) {
return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero);
}
+// static
+scoped_refptr<VideoFrame> VideoFrame::CreateTransparentFrame(
+ const gfx::Size& size) {
+ const uint8 kBlackY = 0x00;
+ const uint8 kBlackUV = 0x00;
+ const uint8 kTransparentA = 0x00;
+ const base::TimeDelta kZero;
+ scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame(
+ VideoFrame::YV12A, size, gfx::Rect(size), size, kZero);
+ FillYUVA(frame, kBlackY, kBlackUV, kBlackUV, kTransparentA);
+ return frame;
+}
+
#if defined(VIDEO_HOLE)
// This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not
// maintained by the general compositor team. Please contact the following
« no previous file with comments | « media/base/video_frame.h ('k') | media/base/video_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698