Index: cc/ipc/quads_struct_traits.h |
diff --git a/cc/ipc/quads_struct_traits.h b/cc/ipc/quads_struct_traits.h |
index 06fd68c20d7aea6a86c1451bfeff1d7434d0a5d1..6a31f9a080b0008eca63b2e90dcdbcdbc1c245c1 100644 |
--- a/cc/ipc/quads_struct_traits.h |
+++ b/cc/ipc/quads_struct_traits.h |
@@ -19,6 +19,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" |
@@ -53,6 +54,8 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> { |
return cc::mojom::DrawQuadStateDataView::Tag::TILE_QUAD_STATE; |
case cc::DrawQuad::YUV_VIDEO_CONTENT: |
return cc::mojom::DrawQuadStateDataView::Tag::YUV_VIDEO_QUAD_STATE; |
+ case cc::DrawQuad::Y_VIDEO_CONTENT: |
+ return cc::mojom::DrawQuadStateDataView::Tag::Y_VIDEO_QUAD_STATE; |
} |
NOTREACHED(); |
return cc::mojom::DrawQuadStateDataView::Tag::DEBUG_BORDER_QUAD_STATE; |
@@ -90,6 +93,10 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> { |
return quad; |
} |
+ static const cc::DrawQuad& y_video_quad_state(const cc::DrawQuad& quad) { |
+ return quad; |
+ } |
+ |
static bool Read(cc::mojom::DrawQuadStateDataView data, cc::DrawQuad* out) { |
switch (data.tag()) { |
case cc::mojom::DrawQuadStateDataView::Tag::DEBUG_BORDER_QUAD_STATE: |
@@ -108,6 +115,8 @@ struct UnionTraits<cc::mojom::DrawQuadStateDataView, cc::DrawQuad> { |
return data.ReadStreamVideoQuadState(out); |
case cc::mojom::DrawQuadStateDataView::Tag::YUV_VIDEO_QUAD_STATE: |
return data.ReadYuvVideoQuadState(out); |
+ case cc::mojom::DrawQuadStateDataView::Tag::Y_VIDEO_QUAD_STATE: |
+ return data.ReadYVideoQuadState(out); |
} |
NOTREACHED(); |
return false; |
@@ -407,6 +416,26 @@ struct StructTraits<cc::mojom::YUVVideoQuadStateDataView, cc::DrawQuad> { |
cc::DrawQuad* out); |
}; |
+template <> |
+struct StructTraits<cc::mojom::YVideoQuadStateDataView, cc::DrawQuad> { |
+ 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); |
+}; |
+ |
struct DrawQuadWithSharedQuadState { |
const cc::DrawQuad* quad; |
const cc::SharedQuadState* shared_quad_state; |