| 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 SkScalar radius = SkScalarHalf(fWidth); | 1407 SkScalar radius = SkScalarHalf(fWidth); |
| 1408 | 1408 |
| 1409 AutoTmpPath tmp(src, &dst); | 1409 AutoTmpPath tmp(src, &dst); |
| 1410 | 1410 |
| 1411 if (radius <= 0) { | 1411 if (radius <= 0) { |
| 1412 return; | 1412 return; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 // If src is really a rect, call our specialty strokeRect() method | 1415 // If src is really a rect, call our specialty strokeRect() method |
| 1416 { | 1416 { |
| 1417 SkRect rect; |
| 1417 bool isClosed; | 1418 bool isClosed; |
| 1418 SkPath::Direction dir; | 1419 SkPath::Direction dir; |
| 1419 if (src.isRect(&isClosed, &dir) && isClosed) { | 1420 if (src.isRect(&rect, &isClosed, &dir) && isClosed) { |
| 1420 this->strokeRect(src.getBounds(), dst, dir); | 1421 this->strokeRect(rect, dst, dir); |
| 1421 // our answer should preserve the inverseness of the src | 1422 // our answer should preserve the inverseness of the src |
| 1422 if (src.isInverseFillType()) { | 1423 if (src.isInverseFillType()) { |
| 1423 SkASSERT(!dst->isInverseFillType()); | 1424 SkASSERT(!dst->isInverseFillType()); |
| 1424 dst->toggleInverseFillType(); | 1425 dst->toggleInverseFillType(); |
| 1425 } | 1426 } |
| 1426 return; | 1427 return; |
| 1427 } | 1428 } |
| 1428 } | 1429 } |
| 1429 | 1430 |
| 1430 SkAutoConicToQuads converter; | 1431 SkAutoConicToQuads converter; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 default: | 1587 default: |
| 1587 break; | 1588 break; |
| 1588 } | 1589 } |
| 1589 | 1590 |
| 1590 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { | 1591 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { |
| 1591 r = rect; | 1592 r = rect; |
| 1592 r.inset(radius, radius); | 1593 r.inset(radius, radius); |
| 1593 dst->addRect(r, reverse_direction(dir)); | 1594 dst->addRect(r, reverse_direction(dir)); |
| 1594 } | 1595 } |
| 1595 } | 1596 } |
| OLD | NEW |