OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2005 Nokia. All rights reserved. | 3 * Copyright (C) 2005 Nokia. 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 FloatPoint shrunkTo(const FloatPoint& other) const | 126 FloatPoint shrunkTo(const FloatPoint& other) const |
127 { | 127 { |
128 return FloatPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y)); | 128 return FloatPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y)); |
129 } | 129 } |
130 | 130 |
131 FloatPoint transposedPoint() const | 131 FloatPoint transposedPoint() const |
132 { | 132 { |
133 return FloatPoint(m_y, m_x); | 133 return FloatPoint(m_y, m_x); |
134 } | 134 } |
135 | 135 |
| 136 FloatPoint scaledBy(float scale) const |
| 137 { |
| 138 return FloatPoint(m_x * scale, m_y * scale); |
| 139 } |
| 140 |
136 #if OS(MACOSX) | 141 #if OS(MACOSX) |
137 FloatPoint(const CGPoint&); | 142 FloatPoint(const CGPoint&); |
138 operator CGPoint() const; | 143 operator CGPoint() const; |
139 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) | 144 #if defined(__OBJC__) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES) |
140 FloatPoint(const NSPoint&); | 145 FloatPoint(const NSPoint&); |
141 operator NSPoint() const; | 146 operator NSPoint() const; |
142 #endif | 147 #endif |
143 #endif | 148 #endif |
144 | 149 |
145 SkPoint data() const; | 150 SkPoint data() const; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 239 } |
235 | 240 |
236 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); | 241 PLATFORM_EXPORT float findSlope(const FloatPoint& p1, const FloatPoint& p2, floa
t& c); |
237 | 242 |
238 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. | 243 // Find point where lines through the two pairs of points intersect. Returns fal
se if the lines don't intersect. |
239 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); | 244 PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, const FloatPoint& p2
, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& intersection); |
240 | 245 |
241 } | 246 } |
242 | 247 |
243 #endif | 248 #endif |
OLD | NEW |