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/converters/geometry/geometry_type_converters.h" | 5 #include "mojo/converters/geometry/geometry_type_converters.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 | 8 |
9 // static | 9 // static |
10 PointPtr TypeConverter<PointPtr, gfx::Point>::Convert(const gfx::Point& input) { | 10 PointPtr TypeConverter<PointPtr, gfx::Point>::Convert(const gfx::Point& input) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 return rect.Pass(); | 80 return rect.Pass(); |
81 } | 81 } |
82 | 82 |
83 // static | 83 // static |
84 gfx::RectF TypeConverter<gfx::RectF, RectFPtr>::Convert(const RectFPtr& input) { | 84 gfx::RectF TypeConverter<gfx::RectF, RectFPtr>::Convert(const RectFPtr& input) { |
85 if (input.is_null()) | 85 if (input.is_null()) |
86 return gfx::RectF(); | 86 return gfx::RectF(); |
87 return gfx::RectF(input->x, input->y, input->width, input->height); | 87 return gfx::RectF(input->x, input->y, input->width, input->height); |
88 } | 88 } |
89 | 89 |
| 90 // static |
| 91 Rect TypeConverter<Rect, gfx::Rect>::Convert(const gfx::Rect& input) { |
| 92 Rect rect; |
| 93 rect.x = input.x(); |
| 94 rect.y = input.y(); |
| 95 rect.width = input.width(); |
| 96 rect.height = input.height(); |
| 97 return rect; |
| 98 } |
| 99 |
| 100 // static |
| 101 gfx::Rect TypeConverter<gfx::Rect, Rect>::Convert(const Rect& input) { |
| 102 return gfx::Rect(input.x, input.y, input.width, input.height); |
| 103 } |
| 104 |
90 } // namespace mojo | 105 } // namespace mojo |
OLD | NEW |