OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * 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 |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "SkGeometry.h" | 7 #include "SkGeometry.h" |
8 #include "SkOpEdgeBuilder.h" | 8 #include "SkOpEdgeBuilder.h" |
9 #include "SkReduceOrder.h" | 9 #include "SkReduceOrder.h" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 continue; // skip degenerate points | 104 continue; // skip degenerate points |
105 } | 105 } |
106 break; | 106 break; |
107 case SkPath::kConic_Verb: { | 107 case SkPath::kConic_Verb: { |
108 const SkPoint* quadPts = quadder.computeQuads(pts, iter.coni
cWeight(), | 108 const SkPoint* quadPts = quadder.computeQuads(pts, iter.coni
cWeight(), |
109 quadderTol); | 109 quadderTol); |
110 const int nQuads = quadder.countQuads(); | 110 const int nQuads = quadder.countQuads(); |
111 for (int i = 0; i < nQuads; ++i) { | 111 for (int i = 0; i < nQuads; ++i) { |
112 fPathVerbs.push_back(SkPath::kQuad_Verb); | 112 fPathVerbs.push_back(SkPath::kQuad_Verb); |
113 } | 113 } |
114 fPathPts.push_back_n(nQuads * 2, quadPts); | 114 fPathPts.push_back_n(nQuads * 2, &quadPts[1]); |
115 curve[0] = quadPts[nQuads * 2 - 1]; | 115 curve[0] = pts[2]; |
116 lastCurve = true; | 116 lastCurve = true; |
117 } | 117 } |
118 continue; | 118 continue; |
119 case SkPath::kCubic_Verb: | 119 case SkPath::kCubic_Verb: |
120 force_small_to_zero(&pts[1]); | 120 force_small_to_zero(&pts[1]); |
121 force_small_to_zero(&pts[2]); | 121 force_small_to_zero(&pts[2]); |
122 force_small_to_zero(&pts[3]); | 122 force_small_to_zero(&pts[3]); |
123 curve[1] = pts[1]; | 123 curve[1] = pts[1]; |
124 curve[2] = pts[2]; | 124 curve[2] = pts[2]; |
125 curve[3] = pts[3]; | 125 curve[3] = pts[3]; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return false; | 199 return false; |
200 } | 200 } |
201 pointsPtr += SkPathOpsVerbToPoints(verb); | 201 pointsPtr += SkPathOpsVerbToPoints(verb); |
202 SkASSERT(fCurrentContour); | 202 SkASSERT(fCurrentContour); |
203 } | 203 } |
204 if (fCurrentContour && !fAllowOpenContours && !close()) { | 204 if (fCurrentContour && !fAllowOpenContours && !close()) { |
205 return false; | 205 return false; |
206 } | 206 } |
207 return true; | 207 return true; |
208 } | 208 } |
OLD | NEW |