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

Unified Diff: media/base/video_util.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_util.h ('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/base/video_util.cc
diff --git a/media/base/video_util.cc b/media/base/video_util.cc
index 09f37b871696df16b012cbd9e59bb3dff04105fa..d7946743eae091cef3f9952c4a0d6cb5acd4ab40 100644
--- a/media/base/video_util.cc
+++ b/media/base/video_util.cc
@@ -96,6 +96,20 @@ void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v) {
}
}
+void FillYUVA(VideoFrame* frame, uint8 y, uint8 u, uint8 v, uint8 a) {
+ // Fill Y, U and V planes.
+ FillYUV(frame, y, u, v);
+
+ // Fill the A plane.
+ uint8* a_plane = frame->data(VideoFrame::kAPlane);
+ int a_rows = frame->rows(VideoFrame::kAPlane);
+ int a_row_bytes = frame->row_bytes(VideoFrame::kAPlane);
+ for (int i = 0; i < a_rows; ++i) {
+ memset(a_plane, a, a_row_bytes);
+ a_plane += frame->stride(VideoFrame::kAPlane);
+ }
+}
+
static void LetterboxPlane(VideoFrame* frame,
int plane,
const gfx::Rect& view_area,
« no previous file with comments | « media/base/video_util.h ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698