Chromium Code Reviews| Index: src/gpu/GrShape.cpp |
| diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp |
| index 0fb339555ecf0dc4f6609c012adbbcaf33517f02..93ecd6187a8ebce094ef47c1741286cf85424f1d 100644 |
| --- a/src/gpu/GrShape.cpp |
| +++ b/src/gpu/GrShape.cpp |
| @@ -332,27 +332,25 @@ void GrShape::attemptToSimplifyPath() { |
| fPath.get()->setIsVolatile(true); |
| } |
| } |
| - if (fPath.get()->isConvex()) { |
| - // There is no distinction between even/odd and non-zero winding count for convex |
| - // paths. |
| - if (fPath.get()->isInverseFillType()) { |
| - fPath.get()->setFillType(SkPath::kInverseEvenOdd_FillType); |
| - } else { |
| - fPath.get()->setFillType(SkPath::kEvenOdd_FillType); |
| - } |
| - } |
| - if (this->style().isDashed()) { |
| - // Dashing ignores inverseness (skbug.com/5421) |
| - switch (fPath.get()->getFillType()) { |
| - case SkPath::kWinding_FillType: |
| - case SkPath::kEvenOdd_FillType: |
| - break; |
| - case SkPath::kInverseWinding_FillType: |
| - fPath.get()->setFillType(SkPath::kWinding_FillType); |
| - break; |
| - case SkPath::kInverseEvenOdd_FillType: |
| - fPath.get()->setFillType(SkPath::kEvenOdd_FillType); |
| - break; |
| + if (!this->style().hasNonDashPathEffect()) { |
| + if (this->style().strokeRec().getStyle() == SkStrokeRec::kStroke_Style || |
| + this->style().strokeRec().getStyle() == SkStrokeRec::kHairline_Style) { |
| + // Stroke styles don't differentiate between winding and even/odd. |
| + // Moreover, dashing ignores inverseness (skbug.com/5421) |
|
robertphillips
2016/06/23 18:47:54
why fStyle here and not style() ?
|
| + bool inverse = !this->fStyle.isDashed() && fPath.get()->isInverseFillType(); |
| + if (inverse) { |
| + fPath.get()->setFillType(kDefaultPathInverseFillType); |
| + } else { |
| + fPath.get()->setFillType(kDefaultPathFillType); |
| + } |
| + } else if (fPath.get()->isConvex()) { |
| + // There is no distinction between even/odd and non-zero winding count for convex |
| + // paths. |
| + if (fPath.get()->isInverseFillType()) { |
| + fPath.get()->setFillType(kDefaultPathInverseFillType); |
| + } else { |
| + fPath.get()->setFillType(kDefaultPathFillType); |
| + } |
| } |
| } |
| } |