diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-04 18:08:27 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-04 18:08:27 +0000 |
commit | 6803c219dd3be4a73e7bb5c4bb8a5b1f803624d0 (patch) | |
tree | 9c2510262763e22793e653c83918424e841c1c33 /src/core | |
parent | 1f99d933e5dab98c5047c7fe19fd4d7180c2cad4 (diff) |
Revert of fix the error that path is inversed for stroke and strokeAndFill styles (https://codereview.chromium.org/183683010/)
R=bsalomon@google.com, reed@google.com, yunchao.he@intel.com
TBR=reed@google.com
NOTRY=True
Reason for revert:
broke unittests
Original issue's description:
> fix the error that path is inversed for stroke and strokeAndFill styles.
>
> However, because hairline stroke + fill = fill (see src/core/SkStrokeRec.cpp), strokeAndFill will be thought as fill style when paint.getStrokeWidth() <= 0, this edge case can be inverse-filled.
>
> BUG=skia:2222
>
> Committed: http://code.google.com/p/skia/source/detail?r=14561
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/269903002
git-svn-id: http://skia.googlecode.com/svn/trunk@14562 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 2 | ||||
-rw-r--r-- | src/core/SkDraw.cpp | 7 | ||||
-rw-r--r-- | src/core/SkStroke.cpp | 10 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 34559795e4..6c0fc884e1 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2076,7 +2076,7 @@ void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) { const SkRect& r = path.getBounds(); if (r.width() <= 0 && r.height() <= 0) { - if (path.isInverseFillType() && SkPaint::kFill_Style == paint.getStyle()) { + if (path.isInverseFillType()) { this->internalDrawPaint(paint); } return; diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index ee2e1125ea..c4f5f74eef 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1119,13 +1119,6 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint, SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage); - // make sure the path will not be inverse-stroked. hairlineStroke + fill = fill, - // they can be inverse-filled. - if (devPathPtr->isInverseFillType() && (SkPaint::kStroke_Style == paint->getStyle() || - (SkPaint::kStrokeAndFill_Style == paint->getStyle() && paint->getStrokeWidth() > 0))) { - devPathPtr->toggleInverseFillType(); - } - if (paint->getMaskFilter()) { SkPaint::Style style = doFill ? SkPaint::kFill_Style : SkPaint::kStroke_Style; diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index 7d8d707752..b138c326ba 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -562,9 +562,8 @@ void SkStroke::strokePath(const SkPath& src, SkPath* dst) const { SkPath::Direction dir; if (src.isRect(&isClosed, &dir) && isClosed) { this->strokeRect(src.getBounds(), dst, dir); - // our answer should preserve the inverseness of the src, but the - // rect should not be inverse-stroked. - if (src.isInverseFillType() && fWidth < 0) { + // our answer should preserve the inverseness of the src + if (src.isInverseFillType()) { SkASSERT(!dst->isInverseFillType()); dst->toggleInverseFillType(); } @@ -647,9 +646,8 @@ DONE: #endif } - // our answer should preserve the inverseness of the src, but the path - // should not be inverse-stroked. - if (src.isInverseFillType() && fWidth < 0) { + // our answer should preserve the inverseness of the src + if (src.isInverseFillType()) { SkASSERT(!dst->isInverseFillType()); dst->toggleInverseFillType(); } |