OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. |
3 * 2006 Rob Buis <buis@kde.org> | 3 * 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 4 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void pointAndNormalAtLength(float length, FloatPoint&, float&) const; | 86 void pointAndNormalAtLength(float length, FloatPoint&, float&) const; |
87 | 87 |
88 // Helper for computing a sequence of positions and normals (normal angles)
on a path. | 88 // Helper for computing a sequence of positions and normals (normal angles)
on a path. |
89 // The best possible access pattern will be one where the |length| value is | 89 // The best possible access pattern will be one where the |length| value is |
90 // strictly increasing. | 90 // strictly increasing. |
91 // For other access patterns, performance will vary depending on curvature | 91 // For other access patterns, performance will vary depending on curvature |
92 // and number of segments, but should never be worse than that of the | 92 // and number of segments, but should never be worse than that of the |
93 // state-less method on Path. | 93 // state-less method on Path. |
94 class PLATFORM_EXPORT PositionCalculator { | 94 class PLATFORM_EXPORT PositionCalculator { |
95 WTF_MAKE_NONCOPYABLE(PositionCalculator); | 95 WTF_MAKE_NONCOPYABLE(PositionCalculator); |
| 96 USING_FAST_MALLOC(PositionCalculator); |
96 public: | 97 public: |
97 explicit PositionCalculator(const Path&); | 98 explicit PositionCalculator(const Path&); |
98 | 99 |
99 void pointAndNormalAtLength(float length, FloatPoint&, float&); | 100 void pointAndNormalAtLength(float length, FloatPoint&, float&); |
100 | 101 |
101 private: | 102 private: |
102 SkPath m_path; | 103 SkPath m_path; |
103 SkPathMeasure m_pathMeasure; | 104 SkPathMeasure m_pathMeasure; |
104 SkScalar m_accumulatedLength; | 105 SkScalar m_accumulatedLength; |
105 }; | 106 }; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 SkPath m_path; | 157 SkPath m_path; |
157 }; | 158 }; |
158 | 159 |
159 #if ENABLE(ASSERT) | 160 #if ENABLE(ASSERT) |
160 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); | 161 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); |
161 #endif | 162 #endif |
162 | 163 |
163 } // namespace blink | 164 } // namespace blink |
164 | 165 |
165 #endif | 166 #endif |
OLD | NEW |