| Index: cc/ipc/quads_struct_traits.h
|
| diff --git a/cc/ipc/quads_struct_traits.h b/cc/ipc/quads_struct_traits.h
|
| index ed602beb8f1aed81776fde2c93b702e2fca5fa19..563be4b23a33f0b20fb7bab97d531d5c2ba25590 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"
|
|
|
| @@ -391,6 +392,36 @@ 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;
|
|
|