OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 #ifndef GrPathUtils_DEFINED | 8 #ifndef GrPathUtils_DEFINED |
11 #define GrPathUtils_DEFINED | 9 #define GrPathUtils_DEFINED |
12 | 10 |
13 #include "GrRect.h" | 11 #include "GrPoint.h" |
| 12 #include "SkRect.h" |
14 #include "SkPath.h" | 13 #include "SkPath.h" |
15 #include "SkTArray.h" | 14 #include "SkTArray.h" |
16 | 15 |
17 class SkMatrix; | 16 class SkMatrix; |
18 | 17 |
19 /** | 18 /** |
20 * Utilities for evaluating paths. | 19 * Utilities for evaluating paths. |
21 */ | 20 */ |
22 namespace GrPathUtils { | 21 namespace GrPathUtils { |
23 SkScalar scaleToleranceToSrc(SkScalar devTol, | 22 SkScalar scaleToleranceToSrc(SkScalar devTol, |
24 const SkMatrix& viewM, | 23 const SkMatrix& viewM, |
25 const GrRect& pathBounds); | 24 const SkRect& pathBounds); |
26 | 25 |
27 /// Since we divide by tol if we're computing exact worst-case bounds, | 26 /// Since we divide by tol if we're computing exact worst-case bounds, |
28 /// very small tolerances will be increased to gMinCurveTol. | 27 /// very small tolerances will be increased to gMinCurveTol. |
29 int worstCasePointCount(const SkPath&, | 28 int worstCasePointCount(const SkPath&, |
30 int* subpaths, | 29 int* subpaths, |
31 SkScalar tol); | 30 SkScalar tol); |
32 | 31 |
33 /// Since we divide by tol if we're computing exact worst-case bounds, | 32 /// Since we divide by tol if we're computing exact worst-case bounds, |
34 /// very small tolerances will be increased to gMinCurveTol. | 33 /// very small tolerances will be increased to gMinCurveTol. |
35 uint32_t quadraticPointCount(const GrPoint points[], SkScalar tol); | 34 uint32_t quadraticPointCount(const GrPoint points[], SkScalar tol); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Setting constrainWithinTangents to true enforces this property. When this | 110 // Setting constrainWithinTangents to true enforces this property. When this |
112 // is true the cubic must be simple and dir must specify the orientation of | 111 // is true the cubic must be simple and dir must specify the orientation of |
113 // the cubic. Otherwise, dir is ignored. | 112 // the cubic. Otherwise, dir is ignored. |
114 void convertCubicToQuads(const GrPoint p[4], | 113 void convertCubicToQuads(const GrPoint p[4], |
115 SkScalar tolScale, | 114 SkScalar tolScale, |
116 bool constrainWithinTangents, | 115 bool constrainWithinTangents, |
117 SkPath::Direction dir, | 116 SkPath::Direction dir, |
118 SkTArray<SkPoint, true>* quads); | 117 SkTArray<SkPoint, true>* quads); |
119 }; | 118 }; |
120 #endif | 119 #endif |
OLD | NEW |