OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/yuv_video_draw_quad.h" | 5 #include "cc/yuv_video_draw_quad.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 scoped_ptr<YUVVideoDrawQuad> YUVVideoDrawQuad::create( | 11 YUVVideoDrawQuad::YUVVideoDrawQuad() {} |
12 const SharedQuadState* sharedQuadState, | 12 YUVVideoDrawQuad::~YUVVideoDrawQuad() {} |
13 const gfx::Rect& quadRect, | 13 |
14 const gfx::Rect& opaqueRect, | 14 scoped_ptr<YUVVideoDrawQuad> YUVVideoDrawQuad::Create() { |
15 const gfx::SizeF& texScale, | 15 return make_scoped_ptr(new YUVVideoDrawQuad); |
16 const VideoLayerImpl::FramePlane& yPlane, | |
17 const VideoLayerImpl::FramePlane& uPlane, | |
18 const VideoLayerImpl::FramePlane& vPlane) | |
19 { | |
20 return make_scoped_ptr(new YUVVideoDrawQuad(sharedQuadState, | |
21 quadRect, opaqueRect, texScale, | |
22 yPlane, uPlane, vPlane)); | |
23 } | 16 } |
24 | 17 |
25 YUVVideoDrawQuad::YUVVideoDrawQuad( | 18 void YUVVideoDrawQuad::SetNew(const SharedQuadState* shared_quad_state, |
26 const SharedQuadState* sharedQuadState, | 19 gfx::Rect rect, |
27 const gfx::Rect& quadRect, | 20 gfx::Rect opaque_rect, |
28 const gfx::Rect& opaqueRect, | 21 gfx::SizeF tex_scale, |
29 const gfx::SizeF& texScale, | 22 const VideoLayerImpl::FramePlane& y_plane, |
30 const VideoLayerImpl::FramePlane& yPlane, | 23 const VideoLayerImpl::FramePlane& u_plane, |
31 const VideoLayerImpl::FramePlane& uPlane, | 24 const VideoLayerImpl::FramePlane& v_plane) { |
32 const VideoLayerImpl::FramePlane& vPlane) | 25 gfx::Rect visible_rect = rect; |
33 : m_texScale(texScale) | 26 bool needs_blending = false; |
34 , m_yPlane(yPlane) | 27 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect, |
35 , m_uPlane(uPlane) | 28 opaque_rect, visible_rect, needs_blending); |
36 , m_vPlane(vPlane) | 29 this->tex_scale = tex_scale; |
37 { | 30 this->y_plane = y_plane; |
38 gfx::Rect visibleRect = quadRect; | 31 this->u_plane = u_plane; |
39 bool needsBlending = false; | 32 this->v_plane = v_plane; |
40 DrawQuad::SetAll(sharedQuadState, DrawQuad::YUV_VIDEO_CONTENT, quadRect, opa
queRect, visibleRect, needsBlending); | |
41 } | 33 } |
42 | 34 |
43 YUVVideoDrawQuad::~YUVVideoDrawQuad() | 35 void YUVVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state, |
44 { | 36 gfx::Rect rect, |
| 37 gfx::Rect opaque_rect, |
| 38 gfx::Rect visible_rect, |
| 39 bool needs_blending, |
| 40 gfx::SizeF tex_scale, |
| 41 const VideoLayerImpl::FramePlane& y_plane, |
| 42 const VideoLayerImpl::FramePlane& u_plane, |
| 43 const VideoLayerImpl::FramePlane& v_plane) { |
| 44 DrawQuad::SetAll(shared_quad_state, DrawQuad::YUV_VIDEO_CONTENT, rect, |
| 45 opaque_rect, visible_rect, needs_blending); |
| 46 this->tex_scale = tex_scale; |
| 47 this->y_plane = y_plane; |
| 48 this->u_plane = u_plane; |
| 49 this->v_plane = v_plane; |
45 } | 50 } |
46 | 51 |
47 const YUVVideoDrawQuad* YUVVideoDrawQuad::materialCast(const DrawQuad* quad) | 52 const YUVVideoDrawQuad* YUVVideoDrawQuad::MaterialCast( |
48 { | 53 const DrawQuad* quad) { |
49 DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT); | 54 DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT); |
50 return static_cast<const YUVVideoDrawQuad*>(quad); | 55 return static_cast<const YUVVideoDrawQuad*>(quad); |
51 } | 56 } |
52 | 57 |
53 } // namespace cc | 58 } // namespace cc |
OLD | NEW |