| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006, 2007 Eric Seidel <eric@webkit.org> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 { | 29 { |
| 30 return FloatPoint((first.x() + second.x()) / 2.0f, (first.y() + second.y())
/ 2.0f); | 30 return FloatPoint((first.x() + second.x()) / 2.0f, (first.y() + second.y())
/ 2.0f); |
| 31 } | 31 } |
| 32 | 32 |
| 33 static inline float distanceLine(const FloatPoint& start, const FloatPoint& end) | 33 static inline float distanceLine(const FloatPoint& start, const FloatPoint& end) |
| 34 { | 34 { |
| 35 return sqrtf((end.x() - start.x()) * (end.x() - start.x()) + (end.y() - star
t.y()) * (end.y() - start.y())); | 35 return sqrtf((end.x() - start.x()) * (end.x() - start.x()) + (end.y() - star
t.y()) * (end.y() - start.y())); |
| 36 } | 36 } |
| 37 | 37 |
| 38 struct QuadraticBezier { | 38 struct QuadraticBezier { |
| 39 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 39 QuadraticBezier() { } | 40 QuadraticBezier() { } |
| 40 QuadraticBezier(const FloatPoint& s, const FloatPoint& c, const FloatPoint&
e) | 41 QuadraticBezier(const FloatPoint& s, const FloatPoint& c, const FloatPoint&
e) |
| 41 : start(s) | 42 : start(s) |
| 42 , control(c) | 43 , control(c) |
| 43 , end(e) | 44 , end(e) |
| 44 , splitDepth(0) | 45 , splitDepth(0) |
| 45 { | 46 { |
| 46 } | 47 } |
| 47 | 48 |
| 48 double magnitudeSquared() const | 49 double magnitudeSquared() const |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 left.splitDepth = right.splitDepth = splitDepth + 1; | 71 left.splitDepth = right.splitDepth = splitDepth + 1; |
| 71 } | 72 } |
| 72 | 73 |
| 73 FloatPoint start; | 74 FloatPoint start; |
| 74 FloatPoint control; | 75 FloatPoint control; |
| 75 FloatPoint end; | 76 FloatPoint end; |
| 76 unsigned short splitDepth; | 77 unsigned short splitDepth; |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 struct CubicBezier { | 80 struct CubicBezier { |
| 81 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 80 CubicBezier() { } | 82 CubicBezier() { } |
| 81 CubicBezier(const FloatPoint& s, const FloatPoint& c1, const FloatPoint& c2,
const FloatPoint& e) | 83 CubicBezier(const FloatPoint& s, const FloatPoint& c1, const FloatPoint& c2,
const FloatPoint& e) |
| 82 : start(s) | 84 : start(s) |
| 83 , control1(c1) | 85 , control1(c1) |
| 84 , control2(c2) | 86 , control2(c2) |
| 85 , end(e) | 87 , end(e) |
| 86 , splitDepth(0) | 88 , splitDepth(0) |
| 87 { | 89 { |
| 88 } | 90 } |
| 89 | 91 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } else { | 216 } else { |
| 215 m_normalAngle = rad2deg(slope); | 217 m_normalAngle = rad2deg(slope); |
| 216 } | 218 } |
| 217 m_success = true; | 219 m_success = true; |
| 218 } | 220 } |
| 219 m_previous = m_current; | 221 m_previous = m_current; |
| 220 } | 222 } |
| 221 | 223 |
| 222 } // namespace blink | 224 } // namespace blink |
| 223 | 225 |
| OLD | NEW |