| Index: cc/ipc/quads_struct_traits.h
|
| diff --git a/cc/ipc/quads_struct_traits.h b/cc/ipc/quads_struct_traits.h
|
| index f495efecdf457a5028f610ed02c7b33abf1de370..7bf586794463df838703d5165ced568eeb464124 100644
|
| --- a/cc/ipc/quads_struct_traits.h
|
| +++ b/cc/ipc/quads_struct_traits.h
|
| @@ -18,6 +18,7 @@
|
| #include "cc/quads/surface_draw_quad.h"
|
| #include "cc/quads/texture_draw_quad.h"
|
| #include "cc/quads/tile_draw_quad.h"
|
| +#include "cc/quads/y_video_draw_quad.h"
|
| #include "cc/quads/yuv_video_draw_quad.h"
|
| #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
|
|
|
| @@ -356,6 +357,37 @@ struct StructTraits<cc::mojom::YUVVideoQuadState, cc::DrawQuad> {
|
| };
|
|
|
| template <>
|
| +struct StructTraits<cc::mojom::YVideoQuadState, cc::DrawQuad> {
|
| + static bool IsNull(const cc::DrawQuad& input) {
|
| + return input.material != cc::DrawQuad::Y_VIDEO_CONTENT;
|
| + }
|
| +
|
| + static void SetToNull(cc::DrawQuad* output) {
|
| + // There is nothing to deserialize here if the DrawQuad is not a
|
| + // YVideoContentDrawQuad. If it is, then this should not be called.
|
| + DCHECK_NE(cc::DrawQuad::Y_VIDEO_CONTENT, output->material);
|
| + }
|
| +
|
| + static uint32_t resource_id(const cc::DrawQuad& input) {
|
| + const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
|
| + return quad->resource_id();
|
| + }
|
| +
|
| + static const gfx::PointF& uv_top_left(const cc::DrawQuad& input) {
|
| + const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
|
| + return quad->uv_top_left;
|
| + }
|
| +
|
| + static const gfx::PointF& uv_bottom_right(const cc::DrawQuad& input) {
|
| + const cc::YVideoDrawQuad* quad = cc::YVideoDrawQuad::MaterialCast(&input);
|
| + return quad->uv_bottom_right;
|
| + }
|
| +
|
| + static bool Read(cc::mojom::YVideoQuadStateDataView data, cc::DrawQuad* out);
|
| +};
|
| +
|
| +
|
| +template <>
|
| struct StructTraits<cc::mojom::DrawQuad, cc::DrawQuad> {
|
| static cc::DrawQuad::Material material(const cc::DrawQuad& quad) {
|
| return quad.material;
|
|
|