 Chromium Code Reviews
 Chromium Code Reviews Issue 12157002:
  Adding YUVA support for enabling Alpha Playback  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 12157002:
  Adding YUVA support for enabling Alpha Playback  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
| 
jamesr
2013/02/14 01:55:19
2013
 | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "cc/yuva_video_draw_quad.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace cc { | |
| 10 | |
| 11 YUVAVideoDrawQuad::YUVAVideoDrawQuad() {} | |
| 12 YUVAVideoDrawQuad::~YUVAVideoDrawQuad() {} | |
| 13 | |
| 14 scoped_ptr<YUVAVideoDrawQuad> YUVAVideoDrawQuad::Create() { | |
| 15 return make_scoped_ptr(new YUVAVideoDrawQuad); | |
| 16 } | |
| 17 | |
| 18 void YUVAVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state, | |
| 19 gfx::Rect rect, | |
| 20 gfx::Rect opaque_rect, | |
| 21 gfx::SizeF tex_scale, | |
| 22 const VideoLayerImpl::FramePlane& y_plane, | |
| 23 const VideoLayerImpl::FramePlane& u_plane, | |
| 24 const VideoLayerImpl::FramePlane& v_plane, | |
| 25 const VideoLayerImpl::FramePlane& a_plane) { | |
| 26 gfx::Rect visible_rect = rect; | |
| 
jzern
2013/02/13 19:56:14
4 space indent is the local norm
 | |
| 27 bool needs_blending = true; | |
| 28 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUVA_VIDEO_CONTENT, rect, | |
| 29 opaque_rect, visible_rect, needs_blending); | |
| 30 this->tex_scale = tex_scale; | |
| 31 this->y_plane = y_plane; | |
| 32 this->u_plane = u_plane; | |
| 33 this->v_plane = v_plane; | |
| 34 this->a_plane = a_plane; | |
| 35 } | |
| 36 | |
| 37 void YUVAVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state, | |
| 38 gfx::Rect rect, | |
| 39 gfx::Rect opaque_rect, | |
| 40 gfx::Rect visible_rect, | |
| 41 bool needs_blending, | |
| 42 gfx::SizeF tex_scale, | |
| 43 const VideoLayerImpl::FramePlane& y_plane, | |
| 44 const VideoLayerImpl::FramePlane& u_plane, | |
| 45 const VideoLayerImpl::FramePlane& v_plane, | |
| 46 const VideoLayerImpl::FramePlane& a_plane) { | |
| 47 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUVA_VIDEO_CONTENT, rect, | |
| 48 opaque_rect, visible_rect, needs_blending); | |
| 49 this->tex_scale = tex_scale; | |
| 50 this->y_plane = y_plane; | |
| 51 this->u_plane = u_plane; | |
| 52 this->v_plane = v_plane; | |
| 53 this->a_plane = a_plane; | |
| 54 } | |
| 55 | |
| 56 const YUVAVideoDrawQuad* YUVAVideoDrawQuad::MaterialCast( | |
| 57 const DrawQuad* quad) { | |
| 
jzern
2013/02/13 19:56:14
could be 1 line
 | |
| 58 DCHECK(quad->material == DrawQuad::YUVA_VIDEO_CONTENT); | |
| 59 return static_cast<const YUVAVideoDrawQuad*>(quad); | |
| 60 } | |
| 61 | |
| 62 } // namespace cc | |
| OLD | NEW |