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
3 // found in the LICENSE file.
5 #ifndef CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_
6 #define CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
11 #include "cc/layers/video_layer_impl.h"
12 #include "cc/quads/draw_quad.h"
16 class CC_EXPORT YUVVideoDrawQuad
: public DrawQuad
{
19 REC_601
, // SDTV standard with restricted "studio swing" color range.
20 REC_709
, // HDTV standard with restricted "studio swing" color range.
21 JPEG
, // Full color range [0, 255] JPEG color space.
22 COLOR_SPACE_LAST
= JPEG
25 ~YUVVideoDrawQuad() override
;
29 void SetNew(const SharedQuadState
* shared_quad_state
,
30 const gfx::Rect
& rect
,
31 const gfx::Rect
& opaque_rect
,
32 const gfx::Rect
& visible_rect
,
33 const gfx::RectF
& tex_coord_rect
,
34 const gfx::Size
& tex_size
,
35 unsigned y_plane_resource_id
,
36 unsigned u_plane_resource_id
,
37 unsigned v_plane_resource_id
,
38 unsigned a_plane_resource_id
,
39 ColorSpace color_space
);
41 void SetAll(const SharedQuadState
* shared_quad_state
,
42 const gfx::Rect
& rect
,
43 const gfx::Rect
& opaque_rect
,
44 const gfx::Rect
& visible_rect
,
46 const gfx::RectF
& tex_coord_rect
,
47 const gfx::Size
& tex_size
,
48 unsigned y_plane_resource_id
,
49 unsigned u_plane_resource_id
,
50 unsigned v_plane_resource_id
,
51 unsigned a_plane_resource_id
,
52 ColorSpace color_space
);
54 gfx::RectF tex_coord_rect
;
55 // Empty texture size implies no clamping of texture coordinates.
57 unsigned y_plane_resource_id
;
58 unsigned u_plane_resource_id
;
59 unsigned v_plane_resource_id
;
60 unsigned a_plane_resource_id
;
61 ColorSpace color_space
;
63 void IterateResources(const ResourceIteratorCallback
& callback
) override
;
65 static const YUVVideoDrawQuad
* MaterialCast(const DrawQuad
*);
68 void ExtendValue(base::trace_event::TracedValue
* value
) const override
;
73 #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_