| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return true; | 399 return true; |
| 400 case SkPath::kClose_Verb: | 400 case SkPath::kClose_Verb: |
| 401 case SkPath::kDone_Verb: | 401 case SkPath::kDone_Verb: |
| 402 return false; | 402 return false; |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 return false; | 405 return false; |
| 406 } | 406 } |
| 407 | 407 |
| 408 void SkPathStroker::lineTo(const SkPoint& currPt, const SkPath::Iter* iter) { | 408 void SkPathStroker::lineTo(const SkPoint& currPt, const SkPath::Iter* iter) { |
| 409 if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper | 409 bool teenyLine = fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero *
fInvResScale); |
| 410 && fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero * fInvR
esScale)) { | 410 if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper && teenyLine) { |
| 411 return; | 411 return; |
| 412 } | 412 } |
| 413 if (fPrevPt == currPt && (fJoinCompleted || (iter && has_valid_tangent(iter)
))) { | 413 if (teenyLine && (fJoinCompleted || (iter && has_valid_tangent(iter)))) { |
| 414 return; | 414 return; |
| 415 } | 415 } |
| 416 SkVector normal, unitNormal; | 416 SkVector normal, unitNormal; |
| 417 | 417 |
| 418 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { | 418 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { |
| 419 return; | 419 return; |
| 420 } | 420 } |
| 421 this->line_to(currPt, normal); | 421 this->line_to(currPt, normal); |
| 422 this->postJoinTo(currPt, normal, unitNormal); | 422 this->postJoinTo(currPt, normal, unitNormal); |
| 423 } | 423 } |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 default: | 1531 default: |
| 1532 break; | 1532 break; |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { | 1535 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { |
| 1536 r = rect; | 1536 r = rect; |
| 1537 r.inset(radius, radius); | 1537 r.inset(radius, radius); |
| 1538 dst->addRect(r, reverse_direction(dir)); | 1538 dst->addRect(r, reverse_direction(dir)); |
| 1539 } | 1539 } |
| 1540 } | 1540 } |
| OLD | NEW |