| Index: ui/gfx/geometry/mojo/geometry_struct_traits.h
|
| diff --git a/ui/gfx/geometry/mojo/geometry_struct_traits.h b/ui/gfx/geometry/mojo/geometry_struct_traits.h
|
| index 41e7b4e374f55b7001e73897bb24439c44452dda..abafe98d4166ac045a4e2d238d7d906e4567143d 100644
|
| --- a/ui/gfx/geometry/mojo/geometry_struct_traits.h
|
| +++ b/ui/gfx/geometry/mojo/geometry_struct_traits.h
|
| @@ -14,6 +14,8 @@
|
| #include "ui/gfx/geometry/rect_f.h"
|
| #include "ui/gfx/geometry/size.h"
|
| #include "ui/gfx/geometry/size_f.h"
|
| +#include "ui/gfx/geometry/vector2d.h"
|
| +#include "ui/gfx/geometry/vector2d_f.h"
|
|
|
| namespace mojo {
|
|
|
| @@ -105,6 +107,28 @@ struct StructTraits<gfx::mojom::SizeF, gfx::SizeF> {
|
| }
|
| };
|
|
|
| +template <>
|
| +struct StructTraits<gfx::mojom::Vector2d, gfx::Vector2d> {
|
| + static int x(const gfx::Vector2d& v) { return v.x(); }
|
| + static int y(const gfx::Vector2d& v) { return v.y(); }
|
| + static bool Read(gfx::mojom::Vector2dDataView data, gfx::Vector2d* out) {
|
| + out->set_x(data.x());
|
| + out->set_y(data.y());
|
| + return true;
|
| + }
|
| +};
|
| +
|
| +template <>
|
| +struct StructTraits<gfx::mojom::Vector2dF, gfx::Vector2dF> {
|
| + static float x(const gfx::Vector2dF& v) { return v.x(); }
|
| + static float y(const gfx::Vector2dF& v) { return v.y(); }
|
| + static bool Read(gfx::mojom::Vector2dFDataView data, gfx::Vector2dF* out) {
|
| + out->set_x(data.x());
|
| + out->set_y(data.y());
|
| + return true;
|
| + }
|
| +};
|
| +
|
| } // namespace mojo
|
|
|
| #endif // UI_GFX_GEOMETRY_MOJO_GEOMETRY_STRUCT_TRAITS_H_
|
|
|