Disable antialiasing on interior of filled RRects that need distance vectors
The interior antialiasing was causing a small transparent rectangle in the middle of filled rects
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3062
Change-Id: If0bf26b96c8969af6d81f3a3d6fee59e8c1d747e
Reviewed-on: https://skia-review.googlesource.com/3062
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 3f759e9..c809a47 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -1548,7 +1548,7 @@
static void FillInOverstrokeVerts(CircleVertex** verts, const SkRect& bounds,
SkScalar smInset, SkScalar bigInset, SkScalar xOffset,
- SkScalar outerRadius, GrColor color) {
+ SkScalar outerRadius, SkScalar innerRadius, GrColor color) {
SkASSERT(smInset < bigInset);
// TL
@@ -1556,7 +1556,7 @@
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(xOffset, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
// TR
@@ -1564,35 +1564,35 @@
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(xOffset, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
(*verts)->fPos = SkPoint::Make(bounds.fLeft + bigInset, bounds.fTop + bigInset);
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(0, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
(*verts)->fPos = SkPoint::Make(bounds.fRight - bigInset, bounds.fTop + bigInset);
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(0, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
(*verts)->fPos = SkPoint::Make(bounds.fLeft + bigInset, bounds.fBottom - bigInset);
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(0, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
(*verts)->fPos = SkPoint::Make(bounds.fRight - bigInset, bounds.fBottom - bigInset);
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(0, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
// BL
@@ -1600,7 +1600,7 @@
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(xOffset, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
// BR
@@ -1608,7 +1608,7 @@
(*verts)->fColor = color;
(*verts)->fOffset = SkPoint::Make(xOffset, 0);
(*verts)->fOuterRadius = outerRadius;
- (*verts)->fInnerRadius = 0;
+ (*verts)->fInnerRadius = innerRadius;
(*verts)++;
}
@@ -1715,7 +1715,7 @@
SkScalar maxOffset = -args.fInnerRadius / overstrokeOuterRadius;
FillInOverstrokeVerts(&verts, bounds, outerRadius, overstrokeOuterRadius,
- maxOffset, overstrokeOuterRadius, color);
+ maxOffset, overstrokeOuterRadius, 0.0f, color);
}
if (kFillWithDist_RRectType == args.fType) {
@@ -1724,7 +1724,7 @@
SkScalar xOffset = 1.0f - outerRadius / halfMinDim;
FillInOverstrokeVerts(&verts, bounds, outerRadius, halfMinDim,
- xOffset, halfMinDim, color);
+ xOffset, halfMinDim, -1.0f, color);
}
const uint16_t* primIndices = rrect_type_to_indices(args.fType);