OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 7 |
8 #include "SkBuffer.h" | 8 #include "SkBuffer.h" |
9 #include "SkCubicClipper.h" | 9 #include "SkCubicClipper.h" |
10 #include "SkErrorInternals.h" | 10 #include "SkErrorInternals.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 break; | 268 break; |
269 default: | 269 default: |
270 SkDEBUGFAIL("unknown verb"); | 270 SkDEBUGFAIL("unknown verb"); |
271 } | 271 } |
272 if (-1 != nextPt) { | 272 if (-1 != nextPt) { |
273 if (SkPath::kConic_Verb == verb) { | 273 if (SkPath::kConic_Verb == verb) { |
274 SkConic orig; | 274 SkConic orig; |
275 orig.set(pts, iter.conicWeight()); | 275 orig.set(pts, iter.conicWeight()); |
276 SkPoint quadPts[5]; | 276 SkPoint quadPts[5]; |
277 int count = orig.chopIntoQuadsPOW2(quadPts, 1); | 277 int count = orig.chopIntoQuadsPOW2(quadPts, 1); |
278 SK_ALWAYSBREAK(2 == count); | 278 SkASSERT_RELEASE(2 == count); |
279 | 279 |
280 if (!check_edge_against_rect(quadPts[0], quadPts[2], rect, direc
tion)) { | 280 if (!check_edge_against_rect(quadPts[0], quadPts[2], rect, direc
tion)) { |
281 return false; | 281 return false; |
282 } | 282 } |
283 if (!check_edge_against_rect(quadPts[2], quadPts[4], rect, direc
tion)) { | 283 if (!check_edge_against_rect(quadPts[2], quadPts[4], rect, direc
tion)) { |
284 return false; | 284 return false; |
285 } | 285 } |
286 } else { | 286 } else { |
287 if (!check_edge_against_rect(prevPt, pts[nextPt], rect, directio
n)) { | 287 if (!check_edge_against_rect(prevPt, pts[nextPt], rect, directio
n)) { |
288 return false; | 288 return false; |
(...skipping 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3174 } | 3174 } |
3175 } while (!done); | 3175 } while (!done); |
3176 return SkToBool(tangents.count()) ^ isInverse; | 3176 return SkToBool(tangents.count()) ^ isInverse; |
3177 } | 3177 } |
3178 | 3178 |
3179 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo
int& p2, | 3179 int SkPath::ConvertConicToQuads(const SkPoint& p0, const SkPoint& p1, const SkPo
int& p2, |
3180 SkScalar w, SkPoint pts[], int pow2) { | 3180 SkScalar w, SkPoint pts[], int pow2) { |
3181 const SkConic conic(p0, p1, p2, w); | 3181 const SkConic conic(p0, p1, p2, w); |
3182 return conic.chopIntoQuadsPOW2(pts, pow2); | 3182 return conic.chopIntoQuadsPOW2(pts, pow2); |
3183 } | 3183 } |
OLD | NEW |