Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkGeometry_DEFINED | 10 #ifndef SkGeometry_DEFINED |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 | 65 |
| 66 /** Given 3 points on a quadratic bezier, chop it into 1, 2 beziers such that | 66 /** Given 3 points on a quadratic bezier, chop it into 1, 2 beziers such that |
| 67 the resulting beziers are monotonic in Y. This is called by the scan convert er. | 67 the resulting beziers are monotonic in Y. This is called by the scan convert er. |
| 68 Depending on what is returned, dst[] is treated as follows | 68 Depending on what is returned, dst[] is treated as follows |
| 69 0 dst[0..2] is the original quad | 69 0 dst[0..2] is the original quad |
| 70 1 dst[0..2] and dst[2..4] are the two new quads | 70 1 dst[0..2] and dst[2..4] are the two new quads |
| 71 */ | 71 */ |
| 72 int SkChopQuadAtYExtrema(const SkPoint src[3], SkPoint dst[5]); | 72 int SkChopQuadAtYExtrema(const SkPoint src[3], SkPoint dst[5]); |
| 73 int SkChopQuadAtXExtrema(const SkPoint src[3], SkPoint dst[5]); | 73 int SkChopQuadAtXExtrema(const SkPoint src[3], SkPoint dst[5]); |
| 74 | 74 |
| 75 /** Given 3 points on a quadratic bezier, if the point of maximum | |
| 76 curvature exists on the segment, returns the t value for this | |
| 77 point along the curve. Otherwise it will return a value of 0. | |
| 78 */ | |
| 79 float SkGetTQuadAtMaxCurvature(const SkPoint src[3]); | |
|
bsalomon
2013/07/10 15:14:36
It read don't right.
SkGetQuadTAtMaxCurvature?
Sk
reed1
2013/07/10 16:00:37
SkFindQuadMaxCurvature
| |
| 80 | |
| 75 /** Given 3 points on a quadratic bezier, divide it into 2 quadratics | 81 /** Given 3 points on a quadratic bezier, divide it into 2 quadratics |
| 76 if the point of maximum curvature exists on the quad segment. | 82 if the point of maximum curvature exists on the quad segment. |
| 77 Depending on what is returned, dst[] is treated as follows | 83 Depending on what is returned, dst[] is treated as follows |
| 78 1 dst[0..2] is the original quad | 84 1 dst[0..2] is the original quad |
| 79 2 dst[0..2] and dst[2..4] are the two new quads | 85 2 dst[0..2] and dst[2..4] are the two new quads |
| 80 If dst == null, it is ignored and only the count is returned. | 86 If dst == null, it is ignored and only the count is returned. |
| 81 */ | 87 */ |
| 82 int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5]); | 88 int SkChopQuadAtMaxCurvature(const SkPoint src[3], SkPoint dst[5]); |
| 83 | 89 |
| 84 /** Given 3 points on a quadratic bezier, use degree elevation to | 90 /** Given 3 points on a quadratic bezier, use degree elevation to |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 private: | 298 private: |
| 293 enum { | 299 enum { |
| 294 kQuadCount = 8, // should handle most conics | 300 kQuadCount = 8, // should handle most conics |
| 295 kPointCount = 1 + 2 * kQuadCount, | 301 kPointCount = 1 + 2 * kQuadCount, |
| 296 }; | 302 }; |
| 297 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; | 303 SkAutoSTMalloc<kPointCount, SkPoint> fStorage; |
| 298 int fQuadCount; // #quads for current usage | 304 int fQuadCount; // #quads for current usage |
| 299 }; | 305 }; |
| 300 | 306 |
| 301 #endif | 307 #endif |
| OLD | NEW |