Index: cc/ipc/quads_struct_traits.cc |
diff --git a/cc/ipc/quads_struct_traits.cc b/cc/ipc/quads_struct_traits.cc |
index 7e567f561ca8dac074ea884bfe451581fa65b7e7..530603f9c216138a72857fda38a4abdd9655dd0c 100644 |
--- a/cc/ipc/quads_struct_traits.cc |
+++ b/cc/ipc/quads_struct_traits.cc |
@@ -44,6 +44,10 @@ cc::DrawQuad* AllocateAndConstruct( |
quad = list->AllocateAndConstruct<cc::YUVVideoDrawQuad>(); |
quad->material = cc::DrawQuad::YUV_VIDEO_CONTENT; |
return quad; |
+ case cc::mojom::DrawQuadStateDataView::Tag::Y_VIDEO_QUAD_STATE: |
+ quad = list->AllocateAndConstruct<cc::YVideoDrawQuad>(); |
+ quad->material = cc::DrawQuad::Y_VIDEO_CONTENT; |
+ return quad; |
} |
NOTREACHED(); |
return nullptr; |
@@ -230,4 +234,19 @@ bool StructTraits<cc::mojom::DrawQuadDataView, cc::DrawQuad>::Read( |
return data.ReadDrawQuadState(out); |
} |
+// static |
+bool StructTraits<cc::mojom::YVideoQuadStateDataView, cc::DrawQuad>::Read( |
+ cc::mojom::YVideoQuadStateDataView data, |
+ cc::DrawQuad* out) { |
+ cc::YVideoDrawQuad* quad = static_cast<cc::YVideoDrawQuad*>(out); |
+ quad->resources.ids[cc::YVideoDrawQuad::kResourceIdIndex] = |
+ data.resource_id(); |
+ quad->resources.count = 1; |
+ if (!data.ReadUvTopLeft(&quad->uv_top_left) || |
+ !data.ReadUvBottomRight(&quad->uv_bottom_right)) { |
+ return false; |
+ } |
+ return true; |
+} |
+ |
} // namespace mojo |