OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkEdgeBuilder.h" | 8 #include "SkEdgeBuilder.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkEdge.h" | 10 #include "SkEdge.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 break; | 144 break; |
145 default: | 145 default: |
146 SkDEBUGFAIL("unexpected verb"); | 146 SkDEBUGFAIL("unexpected verb"); |
147 break; | 147 break; |
148 } | 148 } |
149 } | 149 } |
150 } | 150 } |
151 SkASSERT((char*)edge <= (char*)fEdgeList); | 151 SkASSERT((char*)edge <= (char*)fEdgeList); |
152 SkASSERT(edgePtr - fEdgeList <= maxEdgeCount); | 152 SkASSERT(edgePtr - fEdgeList <= maxEdgeCount); |
153 return edgePtr - fEdgeList; | 153 return SkToInt(edgePtr - fEdgeList); |
154 } | 154 } |
155 | 155 |
156 static void handle_quad(SkEdgeBuilder* builder, const SkPoint pts[3]) { | 156 static void handle_quad(SkEdgeBuilder* builder, const SkPoint pts[3]) { |
157 SkPoint monoX[5]; | 157 SkPoint monoX[5]; |
158 int n = SkChopQuadAtYExtrema(pts, monoX); | 158 int n = SkChopQuadAtYExtrema(pts, monoX); |
159 for (int i = 0; i <= n; i++) { | 159 for (int i = 0; i <= n; i++) { |
160 builder->addQuad(&monoX[i * 2]); | 160 builder->addQuad(&monoX[i * 2]); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 default: | 272 default: |
273 SkDEBUGFAIL("unexpected verb"); | 273 SkDEBUGFAIL("unexpected verb"); |
274 break; | 274 break; |
275 } | 275 } |
276 } | 276 } |
277 } | 277 } |
278 fEdgeList = fList.begin(); | 278 fEdgeList = fList.begin(); |
279 return fList.count(); | 279 return fList.count(); |
280 } | 280 } |
OLD | NEW |