OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 5 #include "mojo/geometry/geometry_type_converters.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 | 8 |
9 // static | 9 // static |
10 Point TypeConverter<Point, gfx::Point>::ConvertFrom(const gfx::Point& input, | 10 Point TypeConverter<Point, gfx::Point>::ConvertFrom(const gfx::Point& input, |
11 Buffer* buf) { | 11 Buffer* buf) { |
12 Point::Builder point(buf); | 12 Point::Builder point(buf); |
13 point.set_x(input.x()); | 13 point.set_x(input.x()); |
14 point.set_y(input.y()); | 14 point.set_y(input.y()); |
15 return point.Finish(); | 15 return point.Finish(); |
(...skipping 27 matching lines...) Expand all Loading... |
43 return rect.Finish(); | 43 return rect.Finish(); |
44 } | 44 } |
45 | 45 |
46 // static | 46 // static |
47 gfx::Rect TypeConverter<Rect, gfx::Rect>::ConvertTo(const Rect& input) { | 47 gfx::Rect TypeConverter<Rect, gfx::Rect>::ConvertTo(const Rect& input) { |
48 return gfx::Rect(input.position().x(), input.position().y(), | 48 return gfx::Rect(input.position().x(), input.position().y(), |
49 input.size().width(), input.size().height()); | 49 input.size().width(), input.size().height()); |
50 } | 50 } |
51 | 51 |
52 } // namespace mojo | 52 } // namespace mojo |
OLD | NEW |