OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #if OS(MACOSX) | 94 #if OS(MACOSX) |
95 explicit IntPoint(const CGPoint&); // don't do this implicitly since it's lo
ssy | 95 explicit IntPoint(const CGPoint&); // don't do this implicitly since it's lo
ssy |
96 operator CGPoint() const; | 96 operator CGPoint() const; |
97 | 97 |
98 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 98 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) |
99 explicit IntPoint(const NSPoint&); // don't do this implicitly since it's lo
ssy | 99 explicit IntPoint(const NSPoint&); // don't do this implicitly since it's lo
ssy |
100 operator NSPoint() const; | 100 operator NSPoint() const; |
101 #endif | 101 #endif |
102 #endif | 102 #endif |
103 | 103 |
104 #ifndef NDEBUG | |
105 String toString() const; | 104 String toString() const; |
106 #endif | |
107 | 105 |
108 private: | 106 private: |
109 int m_x, m_y; | 107 int m_x, m_y; |
110 }; | 108 }; |
111 | 109 |
112 inline IntPoint& operator+=(IntPoint& a, const IntSize& b) | 110 inline IntPoint& operator+=(IntPoint& a, const IntSize& b) |
113 { | 111 { |
114 a.move(b.width(), b.height()); | 112 a.move(b.width(), b.height()); |
115 return a; | 113 return a; |
116 } | 114 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 inline IntSize toIntSize(const IntPoint& a) | 157 inline IntSize toIntSize(const IntPoint& a) |
160 { | 158 { |
161 return IntSize(a.x(), a.y()); | 159 return IntSize(a.x(), a.y()); |
162 } | 160 } |
163 | 161 |
164 inline int IntPoint::distanceSquaredToPoint(const IntPoint& point) const | 162 inline int IntPoint::distanceSquaredToPoint(const IntPoint& point) const |
165 { | 163 { |
166 return ((*this) - point).diagonalLengthSquared(); | 164 return ((*this) - point).diagonalLengthSquared(); |
167 } | 165 } |
168 | 166 |
| 167 // Redeclared here to avoid ODR issues. |
| 168 // See platform/testing/GeometryPrinters.h. |
| 169 void PrintTo(const IntPoint&, std::ostream*); |
| 170 |
169 } // namespace blink | 171 } // namespace blink |
170 | 172 |
171 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntPoint); | 173 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntPoint); |
172 | 174 |
173 #endif // IntPoint_h | 175 #endif // IntPoint_h |
OLD | NEW |