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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/video_frame.h ('k') | media/base/video_util.h » ('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 #include "media/base/video_frame.h" 5 #include "media/base/video_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 // static 367 // static
368 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { 368 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) {
369 const uint8 kBlackY = 0x00; 369 const uint8 kBlackY = 0x00;
370 const uint8 kBlackUV = 0x80; 370 const uint8 kBlackUV = 0x80;
371 const base::TimeDelta kZero; 371 const base::TimeDelta kZero;
372 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); 372 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero);
373 } 373 }
374 374
375 // static
376 scoped_refptr<VideoFrame> VideoFrame::CreateTransparentFrame(
377 const gfx::Size& size) {
378 const uint8 kBlackY = 0x00;
379 const uint8 kBlackUV = 0x00;
380 const uint8 kTransparentA = 0x00;
381 const base::TimeDelta kZero;
382 scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame(
383 VideoFrame::YV12A, size, gfx::Rect(size), size, kZero);
384 FillYUVA(frame, kBlackY, kBlackUV, kBlackUV, kTransparentA);
385 return frame;
386 }
387
375 #if defined(VIDEO_HOLE) 388 #if defined(VIDEO_HOLE)
376 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not 389 // This block and other blocks wrapped around #if defined(VIDEO_HOLE) is not
377 // maintained by the general compositor team. Please contact the following 390 // maintained by the general compositor team. Please contact the following
378 // people instead: 391 // people instead:
379 // 392 //
380 // wonsik@chromium.org 393 // wonsik@chromium.org
381 // ycheo@chromium.org 394 // ycheo@chromium.org
382 395
383 // static 396 // static
384 scoped_refptr<VideoFrame> VideoFrame::CreateHoleFrame( 397 scoped_refptr<VideoFrame> VideoFrame::CreateHoleFrame(
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 break; 852 break;
840 for (int row = 0; row < rows(plane); ++row) { 853 for (int row = 0; row < rows(plane); ++row) {
841 base::MD5Update(context, base::StringPiece( 854 base::MD5Update(context, base::StringPiece(
842 reinterpret_cast<char*>(data(plane) + stride(plane) * row), 855 reinterpret_cast<char*>(data(plane) + stride(plane) * row),
843 row_bytes(plane))); 856 row_bytes(plane)));
844 } 857 }
845 } 858 }
846 } 859 }
847 860
848 } // namespace media 861 } // namespace media
OLDNEW
« 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