OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 "SkStrokerPriv.h" | 8 #include "SkStrokerPriv.h" |
9 #include "SkGeometry.h" | 9 #include "SkGeometry.h" |
10 #include "SkPathPriv.h" | 10 #include "SkPathPriv.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 fSegmentCount = 0; | 349 fSegmentCount = 0; |
350 fFirstPt = fPrevPt = pt; | 350 fFirstPt = fPrevPt = pt; |
351 } | 351 } |
352 | 352 |
353 void SkPathStroker::line_to(const SkPoint& currPt, const SkVector& normal) { | 353 void SkPathStroker::line_to(const SkPoint& currPt, const SkVector& normal) { |
354 fOuter.lineTo(currPt.fX + normal.fX, currPt.fY + normal.fY); | 354 fOuter.lineTo(currPt.fX + normal.fX, currPt.fY + normal.fY); |
355 fInner.lineTo(currPt.fX - normal.fX, currPt.fY - normal.fY); | 355 fInner.lineTo(currPt.fX - normal.fX, currPt.fY - normal.fY); |
356 } | 356 } |
357 | 357 |
358 void SkPathStroker::lineTo(const SkPoint& currPt) { | 358 void SkPathStroker::lineTo(const SkPoint& currPt) { |
359 if (SkPath::IsLineDegenerate(fPrevPt, currPt)) { | 359 if (SkPath::IsLineDegenerate(fPrevPt, currPt, false)) { |
360 return; | 360 return; |
361 } | 361 } |
362 SkVector normal, unitNormal; | 362 SkVector normal, unitNormal; |
363 | 363 |
364 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { | 364 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { |
365 return; | 365 return; |
366 } | 366 } |
367 this->line_to(currPt, normal); | 367 this->line_to(currPt, normal); |
368 this->postJoinTo(currPt, normal, unitNormal); | 368 this->postJoinTo(currPt, normal, unitNormal); |
369 } | 369 } |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 default: | 1450 default: |
1451 break; | 1451 break; |
1452 } | 1452 } |
1453 | 1453 |
1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { | 1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { |
1455 r = rect; | 1455 r = rect; |
1456 r.inset(radius, radius); | 1456 r.inset(radius, radius); |
1457 dst->addRect(r, reverse_direction(dir)); | 1457 dst->addRect(r, reverse_direction(dir)); |
1458 } | 1458 } |
1459 } | 1459 } |
OLD | NEW |