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 #ifndef CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ |
6 #define CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ | 6 #define CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const gfx::RectF& ya_tex_coord_rect, | 45 const gfx::RectF& ya_tex_coord_rect, |
46 const gfx::RectF& uv_tex_coord_rect, | 46 const gfx::RectF& uv_tex_coord_rect, |
47 const gfx::Size& ya_tex_size, | 47 const gfx::Size& ya_tex_size, |
48 const gfx::Size& uv_tex_size, | 48 const gfx::Size& uv_tex_size, |
49 unsigned y_plane_resource_id, | 49 unsigned y_plane_resource_id, |
50 unsigned u_plane_resource_id, | 50 unsigned u_plane_resource_id, |
51 unsigned v_plane_resource_id, | 51 unsigned v_plane_resource_id, |
52 unsigned a_plane_resource_id, | 52 unsigned a_plane_resource_id, |
53 ColorSpace color_space, | 53 ColorSpace color_space, |
54 float offset, | 54 float offset, |
55 float multiplier); | 55 float multiplier, |
| 56 uint32_t bits_per_channel); |
56 | 57 |
57 void SetAll(const SharedQuadState* shared_quad_state, | 58 void SetAll(const SharedQuadState* shared_quad_state, |
58 const gfx::Rect& rect, | 59 const gfx::Rect& rect, |
59 const gfx::Rect& opaque_rect, | 60 const gfx::Rect& opaque_rect, |
60 const gfx::Rect& visible_rect, | 61 const gfx::Rect& visible_rect, |
61 bool needs_blending, | 62 bool needs_blending, |
62 // |*_tex_coord_rect| contains non-normalized coordinates. | 63 // |*_tex_coord_rect| contains non-normalized coordinates. |
63 // TODO(reveman): Make the use of normalized vs non-normalized | 64 // TODO(reveman): Make the use of normalized vs non-normalized |
64 // coordinates consistent across all quad types: crbug.com/487370 | 65 // coordinates consistent across all quad types: crbug.com/487370 |
65 const gfx::RectF& ya_tex_coord_rect, | 66 const gfx::RectF& ya_tex_coord_rect, |
66 const gfx::RectF& uv_tex_coord_rect, | 67 const gfx::RectF& uv_tex_coord_rect, |
67 const gfx::Size& ya_tex_size, | 68 const gfx::Size& ya_tex_size, |
68 const gfx::Size& uv_tex_size, | 69 const gfx::Size& uv_tex_size, |
69 unsigned y_plane_resource_id, | 70 unsigned y_plane_resource_id, |
70 unsigned u_plane_resource_id, | 71 unsigned u_plane_resource_id, |
71 unsigned v_plane_resource_id, | 72 unsigned v_plane_resource_id, |
72 unsigned a_plane_resource_id, | 73 unsigned a_plane_resource_id, |
73 ColorSpace color_space, | 74 ColorSpace color_space, |
74 float offset, | 75 float offset, |
75 float multiplier); | 76 float multiplier, |
| 77 uint32_t bits_per_channel); |
76 | 78 |
77 gfx::RectF ya_tex_coord_rect; | 79 gfx::RectF ya_tex_coord_rect; |
78 gfx::RectF uv_tex_coord_rect; | 80 gfx::RectF uv_tex_coord_rect; |
79 gfx::Size ya_tex_size; | 81 gfx::Size ya_tex_size; |
80 gfx::Size uv_tex_size; | 82 gfx::Size uv_tex_size; |
81 ColorSpace color_space; | 83 ColorSpace color_space; |
82 float resource_offset = 0.0f; | 84 float resource_offset = 0.0f; |
83 float resource_multiplier = 1.0f; | 85 float resource_multiplier = 1.0f; |
| 86 uint32_t bits_per_channel = 8; |
84 | 87 |
85 static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); | 88 static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); |
86 | 89 |
87 ResourceId y_plane_resource_id() const { | 90 ResourceId y_plane_resource_id() const { |
88 return resources.ids[kYPlaneResourceIdIndex]; | 91 return resources.ids[kYPlaneResourceIdIndex]; |
89 } | 92 } |
90 ResourceId u_plane_resource_id() const { | 93 ResourceId u_plane_resource_id() const { |
91 return resources.ids[kUPlaneResourceIdIndex]; | 94 return resources.ids[kUPlaneResourceIdIndex]; |
92 } | 95 } |
93 ResourceId v_plane_resource_id() const { | 96 ResourceId v_plane_resource_id() const { |
94 return resources.ids[kVPlaneResourceIdIndex]; | 97 return resources.ids[kVPlaneResourceIdIndex]; |
95 } | 98 } |
96 ResourceId a_plane_resource_id() const { | 99 ResourceId a_plane_resource_id() const { |
97 return resources.ids[kAPlaneResourceIdIndex]; | 100 return resources.ids[kAPlaneResourceIdIndex]; |
98 } | 101 } |
99 | 102 |
100 private: | 103 private: |
101 void ExtendValue(base::trace_event::TracedValue* value) const override; | 104 void ExtendValue(base::trace_event::TracedValue* value) const override; |
102 }; | 105 }; |
103 | 106 |
104 } // namespace cc | 107 } // namespace cc |
105 | 108 |
106 #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ | 109 #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ |
OLD | NEW |