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 "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 } | 1547 } |
1548 } | 1548 } |
1549 | 1549 |
1550 private: | 1550 private: |
1551 SkPath fTmpDst; | 1551 SkPath fTmpDst; |
1552 const SkPath& fSrc; | 1552 const SkPath& fSrc; |
1553 bool fSwapWithSrc; | 1553 bool fSwapWithSrc; |
1554 }; | 1554 }; |
1555 | 1555 |
1556 void SkStroke::strokePath(const SkPath& src, SkPath* dst) const { | 1556 void SkStroke::strokePath(const SkPath& src, SkPath* dst) const { |
1557 SkASSERT(&src != NULL && dst != NULL); | 1557 SkASSERT(dst); |
1558 | 1558 |
1559 SkScalar radius = SkScalarHalf(fWidth); | 1559 SkScalar radius = SkScalarHalf(fWidth); |
1560 | 1560 |
1561 AutoTmpPath tmp(src, &dst); | 1561 AutoTmpPath tmp(src, &dst); |
1562 | 1562 |
1563 if (radius <= 0) { | 1563 if (radius <= 0) { |
1564 return; | 1564 return; |
1565 } | 1565 } |
1566 | 1566 |
1567 // If src is really a rect, call our specialty strokeRect() method | 1567 // If src is really a rect, call our specialty strokeRect() method |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 default: | 1740 default: |
1741 break; | 1741 break; |
1742 } | 1742 } |
1743 | 1743 |
1744 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { | 1744 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { |
1745 r = rect; | 1745 r = rect; |
1746 r.inset(radius, radius); | 1746 r.inset(radius, radius); |
1747 dst->addRect(r, reverse_direction(dir)); | 1747 dst->addRect(r, reverse_direction(dir)); |
1748 } | 1748 } |
1749 } | 1749 } |
OLD | NEW |