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
This commit is contained in:
parent
1f99d933e5
commit
6803c219dd
@ -37,16 +37,3 @@
|
|||||||
# This change removes an API that this GM was testing. If/when it lands and sticks,
|
# This change removes an API that this GM was testing. If/when it lands and sticks,
|
||||||
# I will likely just delete the GM.
|
# I will likely just delete the GM.
|
||||||
canvas-layer-state
|
canvas-layer-state
|
||||||
|
|
||||||
# yunchao: https://codereview.chromium.org/183683010/
|
|
||||||
# This change fixed the error that path is inversed for Stroke and StrokeAndFill
|
|
||||||
# styles. These GM cases need to be rebaselined:
|
|
||||||
inverse_paths
|
|
||||||
degeneratesegments
|
|
||||||
quadclosepath
|
|
||||||
quadpath
|
|
||||||
lineclosepath
|
|
||||||
linepath
|
|
||||||
cubicclosepath
|
|
||||||
cubicpath
|
|
||||||
emptypath
|
|
||||||
|
@ -2076,7 +2076,7 @@ void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
|
|||||||
|
|
||||||
const SkRect& r = path.getBounds();
|
const SkRect& r = path.getBounds();
|
||||||
if (r.width() <= 0 && r.height() <= 0) {
|
if (r.width() <= 0 && r.height() <= 0) {
|
||||||
if (path.isInverseFillType() && SkPaint::kFill_Style == paint.getStyle()) {
|
if (path.isInverseFillType()) {
|
||||||
this->internalDrawPaint(paint);
|
this->internalDrawPaint(paint);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1119,13 +1119,6 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint,
|
|||||||
|
|
||||||
SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage);
|
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()) {
|
if (paint->getMaskFilter()) {
|
||||||
SkPaint::Style style = doFill ? SkPaint::kFill_Style :
|
SkPaint::Style style = doFill ? SkPaint::kFill_Style :
|
||||||
SkPaint::kStroke_Style;
|
SkPaint::kStroke_Style;
|
||||||
|
@ -562,9 +562,8 @@ void SkStroke::strokePath(const SkPath& src, SkPath* dst) const {
|
|||||||
SkPath::Direction dir;
|
SkPath::Direction dir;
|
||||||
if (src.isRect(&isClosed, &dir) && isClosed) {
|
if (src.isRect(&isClosed, &dir) && isClosed) {
|
||||||
this->strokeRect(src.getBounds(), dst, dir);
|
this->strokeRect(src.getBounds(), dst, dir);
|
||||||
// our answer should preserve the inverseness of the src, but the
|
// our answer should preserve the inverseness of the src
|
||||||
// rect should not be inverse-stroked.
|
if (src.isInverseFillType()) {
|
||||||
if (src.isInverseFillType() && fWidth < 0) {
|
|
||||||
SkASSERT(!dst->isInverseFillType());
|
SkASSERT(!dst->isInverseFillType());
|
||||||
dst->toggleInverseFillType();
|
dst->toggleInverseFillType();
|
||||||
}
|
}
|
||||||
@ -647,9 +646,8 @@ DONE:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// our answer should preserve the inverseness of the src, but the path
|
// our answer should preserve the inverseness of the src
|
||||||
// should not be inverse-stroked.
|
if (src.isInverseFillType()) {
|
||||||
if (src.isInverseFillType() && fWidth < 0) {
|
|
||||||
SkASSERT(!dst->isInverseFillType());
|
SkASSERT(!dst->isInverseFillType());
|
||||||
dst->toggleInverseFillType();
|
dst->toggleInverseFillType();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const SkPath& path,
|
|||||||
|
|
||||||
SkAutoTUnref<GrPath> p(fGpu->getContext()->createPath(path, stroke));
|
SkAutoTUnref<GrPath> p(fGpu->getContext()->createPath(path, stroke));
|
||||||
|
|
||||||
if (path.isInverseFillType() && SkStrokeRec::kFill_Style == stroke.getStyle()) {
|
if (path.isInverseFillType()) {
|
||||||
GR_STATIC_CONST_SAME_STENCIL(kInvertedStencilPass,
|
GR_STATIC_CONST_SAME_STENCIL(kInvertedStencilPass,
|
||||||
kZero_StencilOp,
|
kZero_StencilOp,
|
||||||
kZero_StencilOp,
|
kZero_StencilOp,
|
||||||
|
Loading…
Reference in New Issue
Block a user