| Index: mojo/geometry/geometry_type_converters.cc
|
| diff --git a/mojo/geometry/geometry_type_converters.cc b/mojo/geometry/geometry_type_converters.cc
|
| index b01d249b27fbdd84fad2bf72c1f9dca835b06e31..43a39d8e68731708bfaa96a4c80cfb4f4e881881 100644
|
| --- a/mojo/geometry/geometry_type_converters.cc
|
| +++ b/mojo/geometry/geometry_type_converters.cc
|
| @@ -7,46 +7,45 @@
|
| namespace mojo {
|
|
|
| // static
|
| -Point TypeConverter<Point, gfx::Point>::ConvertFrom(const gfx::Point& input,
|
| - Buffer* buf) {
|
| - Point::Builder point(buf);
|
| - point.set_x(input.x());
|
| - point.set_y(input.y());
|
| - return point.Finish();
|
| +PointPtr TypeConverter<PointPtr, gfx::Point>::ConvertFrom(
|
| + const gfx::Point& input) {
|
| + PointPtr point(Point::New());
|
| + point->x = input.x();
|
| + point->y = input.y();
|
| + return point.Pass();
|
| }
|
|
|
| // static
|
| -gfx::Point TypeConverter<Point, gfx::Point>::ConvertTo(const Point& input) {
|
| - return gfx::Point(input.x(), input.y());
|
| +gfx::Point TypeConverter<PointPtr, gfx::Point>::ConvertTo(
|
| + const PointPtr& input) {
|
| + return gfx::Point(input->x, input->y);
|
| }
|
|
|
| // static
|
| -Size TypeConverter<Size, gfx::Size>::ConvertFrom(const gfx::Size& input,
|
| - Buffer* buf) {
|
| - Size::Builder size(buf);
|
| - size.set_width(input.width());
|
| - size.set_height(input.height());
|
| - return size.Finish();
|
| +SizePtr TypeConverter<SizePtr, gfx::Size>::ConvertFrom(const gfx::Size& input) {
|
| + SizePtr size(Size::New());
|
| + size->width = input.width();
|
| + size->height = input.height();
|
| + return size.Pass();
|
| }
|
|
|
| // static
|
| -gfx::Size TypeConverter<Size, gfx::Size>::ConvertTo(const Size& input) {
|
| - return gfx::Size(input.width(), input.height());
|
| +gfx::Size TypeConverter<SizePtr, gfx::Size>::ConvertTo(const SizePtr& input) {
|
| + return gfx::Size(input->width, input->height);
|
| }
|
|
|
| // static
|
| -Rect TypeConverter<Rect, gfx::Rect>::ConvertFrom(const gfx::Rect& input,
|
| - Buffer* buf) {
|
| - Rect::Builder rect(buf);
|
| - rect.set_position(input.origin());
|
| - rect.set_size(input.size());
|
| - return rect.Finish();
|
| +RectPtr TypeConverter<RectPtr, gfx::Rect>::ConvertFrom(const gfx::Rect& input) {
|
| + RectPtr rect(Rect::New());
|
| + rect->position = Point::From(input.origin());
|
| + rect->size = Size::From(input.size());
|
| + return rect.Pass();
|
| }
|
|
|
| // static
|
| -gfx::Rect TypeConverter<Rect, gfx::Rect>::ConvertTo(const Rect& input) {
|
| - return gfx::Rect(input.position().x(), input.position().y(),
|
| - input.size().width(), input.size().height());
|
| +gfx::Rect TypeConverter<RectPtr, gfx::Rect>::ConvertTo(const RectPtr& input) {
|
| + return gfx::Rect(input->position->x, input->position->y,
|
| + input->size->width, input->size->height);
|
| }
|
|
|
| } // namespace mojo
|
|
|