OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_CPP_POINT_H_ | 5 #ifndef PPAPI_CPP_POINT_H_ |
6 #define PPAPI_CPP_POINT_H_ | 6 #define PPAPI_CPP_POINT_H_ |
7 | 7 |
8 #include "ppapi/c/pp_point.h" | 8 #include "ppapi/c/pp_point.h" |
9 | 9 |
10 /// @file | 10 /// @file |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 /// y values. | 94 /// y values. |
95 /// | 95 /// |
96 /// @param[in] other A Point. | 96 /// @param[in] other A Point. |
97 /// | 97 /// |
98 /// @return A new Point containing the result. | 98 /// @return A new Point containing the result. |
99 Point operator+(const Point& other) const { | 99 Point operator+(const Point& other) const { |
100 return Point(x() + other.x(), y() + other.y()); | 100 return Point(x() + other.x(), y() + other.y()); |
101 } | 101 } |
102 | 102 |
103 /// Subtracts one Point from another Point by subtracting their x values | 103 /// Subtracts one Point from another Point by subtracting their x values |
104 /// and y values. Returnes a new point with the result. | 104 /// and y values. Returns a new point with the result. |
105 /// | 105 /// |
106 /// @param[in] other A Point. | 106 /// @param[in] other A Point. |
107 /// | 107 /// |
108 /// @return A new Point containing the result. | 108 /// @return A new Point containing the result. |
109 Point operator-(const Point& other) const { | 109 Point operator-(const Point& other) const { |
110 return Point(x() - other.x(), y() - other.y()); | 110 return Point(x() - other.x(), y() - other.y()); |
111 } | 111 } |
112 | 112 |
113 /// Adds two Points (this and other) together by adding their x and y | 113 /// Adds two Points (this and other) together by adding their x and y |
114 /// values. Returns this point as the result. | 114 /// values. Returns this point as the result. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 /// y values. | 233 /// y values. |
234 /// | 234 /// |
235 /// @param[in] other A Point. | 235 /// @param[in] other A Point. |
236 /// | 236 /// |
237 /// @return A new Point containing the result. | 237 /// @return A new Point containing the result. |
238 FloatPoint operator+(const FloatPoint& other) const { | 238 FloatPoint operator+(const FloatPoint& other) const { |
239 return FloatPoint(x() + other.x(), y() + other.y()); | 239 return FloatPoint(x() + other.x(), y() + other.y()); |
240 } | 240 } |
241 | 241 |
242 /// Subtracts one Point from another Point by subtracting their x values | 242 /// Subtracts one Point from another Point by subtracting their x values |
243 /// and y values. Returnes a new point with the result. | 243 /// and y values. Returns a new point with the result. |
244 /// | 244 /// |
245 /// @param[in] other A FloatPoint. | 245 /// @param[in] other A FloatPoint. |
246 /// | 246 /// |
247 /// @return A new Point containing the result. | 247 /// @return A new Point containing the result. |
248 FloatPoint operator-(const FloatPoint& other) const { | 248 FloatPoint operator-(const FloatPoint& other) const { |
249 return FloatPoint(x() - other.x(), y() - other.y()); | 249 return FloatPoint(x() - other.x(), y() - other.y()); |
250 } | 250 } |
251 | 251 |
252 /// Adds two Points (this and other) together by adding their x and y | 252 /// Adds two Points (this and other) together by adding their x and y |
253 /// values. Returns this point as the result. | 253 /// values. Returns this point as the result. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 /// @param[in] lhs The Point on the left-hand side of the equation. | 327 /// @param[in] lhs The Point on the left-hand side of the equation. |
328 /// @param[in] rhs The Point on the right-hand side of the equation. | 328 /// @param[in] rhs The Point on the right-hand side of the equation. |
329 /// | 329 /// |
330 /// @return true if the coordinates of lhs are equal to the coordinates | 330 /// @return true if the coordinates of lhs are equal to the coordinates |
331 /// of rhs, otherwise false. | 331 /// of rhs, otherwise false. |
332 inline bool operator!=(const pp::FloatPoint& lhs, const pp::FloatPoint& rhs) { | 332 inline bool operator!=(const pp::FloatPoint& lhs, const pp::FloatPoint& rhs) { |
333 return !(lhs == rhs); | 333 return !(lhs == rhs); |
334 } | 334 } |
335 | 335 |
336 #endif // PPAPI_CPP_POINT_H_ | 336 #endif // PPAPI_CPP_POINT_H_ |
OLD | NEW |