| 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> |
| 11 | 11 |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/quads/draw_quad.h" | 13 #include "cc/quads/draw_quad.h" |
| 14 #include "media/base/video_color_space.h" |
| 14 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
| 15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 16 | 17 |
| 17 namespace cc { | 18 namespace cc { |
| 18 | 19 |
| 19 class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { | 20 class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { |
| 20 public: | 21 public: |
| 21 static const size_t kYPlaneResourceIdIndex = 0; | 22 static const size_t kYPlaneResourceIdIndex = 0; |
| 22 static const size_t kUPlaneResourceIdIndex = 1; | 23 static const size_t kUPlaneResourceIdIndex = 1; |
| 23 static const size_t kVPlaneResourceIdIndex = 2; | 24 static const size_t kVPlaneResourceIdIndex = 2; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 // coordinates consistent across all quad types: crbug.com/487370 | 45 // coordinates consistent across all quad types: crbug.com/487370 |
| 45 const gfx::RectF& ya_tex_coord_rect, | 46 const gfx::RectF& ya_tex_coord_rect, |
| 46 const gfx::RectF& uv_tex_coord_rect, | 47 const gfx::RectF& uv_tex_coord_rect, |
| 47 const gfx::Size& ya_tex_size, | 48 const gfx::Size& ya_tex_size, |
| 48 const gfx::Size& uv_tex_size, | 49 const gfx::Size& uv_tex_size, |
| 49 unsigned y_plane_resource_id, | 50 unsigned y_plane_resource_id, |
| 50 unsigned u_plane_resource_id, | 51 unsigned u_plane_resource_id, |
| 51 unsigned v_plane_resource_id, | 52 unsigned v_plane_resource_id, |
| 52 unsigned a_plane_resource_id, | 53 unsigned a_plane_resource_id, |
| 53 ColorSpace color_space, | 54 ColorSpace color_space, |
| 55 const media::VideoColorSpace& video_color_space, |
| 54 float offset, | 56 float offset, |
| 55 float multiplier); | 57 float multiplier); |
| 56 | 58 |
| 57 void SetAll(const SharedQuadState* shared_quad_state, | 59 void SetAll(const SharedQuadState* shared_quad_state, |
| 58 const gfx::Rect& rect, | 60 const gfx::Rect& rect, |
| 59 const gfx::Rect& opaque_rect, | 61 const gfx::Rect& opaque_rect, |
| 60 const gfx::Rect& visible_rect, | 62 const gfx::Rect& visible_rect, |
| 61 bool needs_blending, | 63 bool needs_blending, |
| 62 // |*_tex_coord_rect| contains non-normalized coordinates. | 64 // |*_tex_coord_rect| contains non-normalized coordinates. |
| 63 // TODO(reveman): Make the use of normalized vs non-normalized | 65 // TODO(reveman): Make the use of normalized vs non-normalized |
| 64 // coordinates consistent across all quad types: crbug.com/487370 | 66 // coordinates consistent across all quad types: crbug.com/487370 |
| 65 const gfx::RectF& ya_tex_coord_rect, | 67 const gfx::RectF& ya_tex_coord_rect, |
| 66 const gfx::RectF& uv_tex_coord_rect, | 68 const gfx::RectF& uv_tex_coord_rect, |
| 67 const gfx::Size& ya_tex_size, | 69 const gfx::Size& ya_tex_size, |
| 68 const gfx::Size& uv_tex_size, | 70 const gfx::Size& uv_tex_size, |
| 69 unsigned y_plane_resource_id, | 71 unsigned y_plane_resource_id, |
| 70 unsigned u_plane_resource_id, | 72 unsigned u_plane_resource_id, |
| 71 unsigned v_plane_resource_id, | 73 unsigned v_plane_resource_id, |
| 72 unsigned a_plane_resource_id, | 74 unsigned a_plane_resource_id, |
| 73 ColorSpace color_space, | 75 ColorSpace color_space, |
| 76 const media::VideoColorSpace& video_color_space, |
| 74 float offset, | 77 float offset, |
| 75 float multiplier); | 78 float multiplier); |
| 76 | 79 |
| 77 gfx::RectF ya_tex_coord_rect; | 80 gfx::RectF ya_tex_coord_rect; |
| 78 gfx::RectF uv_tex_coord_rect; | 81 gfx::RectF uv_tex_coord_rect; |
| 79 gfx::Size ya_tex_size; | 82 gfx::Size ya_tex_size; |
| 80 gfx::Size uv_tex_size; | 83 gfx::Size uv_tex_size; |
| 81 ColorSpace color_space; | 84 ColorSpace color_space; |
| 82 float resource_offset = 0.0f; | 85 float resource_offset = 0.0f; |
| 83 float resource_multiplier = 1.0f; | 86 float resource_multiplier = 1.0f; |
| 87 media::VideoColorSpace video_color_space; |
| 84 | 88 |
| 85 static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); | 89 static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); |
| 86 | 90 |
| 87 ResourceId y_plane_resource_id() const { | 91 ResourceId y_plane_resource_id() const { |
| 88 return resources.ids[kYPlaneResourceIdIndex]; | 92 return resources.ids[kYPlaneResourceIdIndex]; |
| 89 } | 93 } |
| 90 ResourceId u_plane_resource_id() const { | 94 ResourceId u_plane_resource_id() const { |
| 91 return resources.ids[kUPlaneResourceIdIndex]; | 95 return resources.ids[kUPlaneResourceIdIndex]; |
| 92 } | 96 } |
| 93 ResourceId v_plane_resource_id() const { | 97 ResourceId v_plane_resource_id() const { |
| 94 return resources.ids[kVPlaneResourceIdIndex]; | 98 return resources.ids[kVPlaneResourceIdIndex]; |
| 95 } | 99 } |
| 96 ResourceId a_plane_resource_id() const { | 100 ResourceId a_plane_resource_id() const { |
| 97 return resources.ids[kAPlaneResourceIdIndex]; | 101 return resources.ids[kAPlaneResourceIdIndex]; |
| 98 } | 102 } |
| 99 | 103 |
| 100 private: | 104 private: |
| 101 void ExtendValue(base::trace_event::TracedValue* value) const override; | 105 void ExtendValue(base::trace_event::TracedValue* value) const override; |
| 102 }; | 106 }; |
| 103 | 107 |
| 104 } // namespace cc | 108 } // namespace cc |
| 105 | 109 |
| 106 #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ | 110 #endif // CC_QUADS_YUV_VIDEO_DRAW_QUAD_H_ |
| OLD | NEW |