Remove HairlineAA from the clip-edge types.
GrQuadEffect and GrConicEffect were the only FPs that supported the
HairlineAA clip-edge type. These FPs have been updated to implicitly
always use HairlineAA, and other FPs no longer need to consider the
HairlineAA case.
This CL also updates the bezier-effects GM images to remove the non-
hairline test columns.
Change-Id: Ice942106344cf48480e972da4aab1c6055f9911e
Bug: skia:10393
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297019
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/generated/GrCircleEffect.cpp b/src/gpu/effects/generated/GrCircleEffect.cpp
index b85ad8f..7011949 100644
--- a/src/gpu/effects/generated/GrCircleEffect.cpp
+++ b/src/gpu/effects/generated/GrCircleEffect.cpp
@@ -51,11 +51,10 @@
_sample2569 = _input2569;
}
fragBuilder->codeAppendf(
- "\nhalf4 inputColor = %s;\n@if ((%d == 1 || %d == 3) || %d == 4) {\n %s = "
- "inputColor * clamp(d, 0.0, 1.0);\n} else {\n %s = d > 0.5 ? inputColor : "
- "half4(0.0);\n}\n",
- _sample2569.c_str(), (int)_outer.edgeType, (int)_outer.edgeType,
- (int)_outer.edgeType, args.fOutputColor, args.fOutputColor);
+ "\nhalf4 inputColor = %s;\n@if (%d == 1 || %d == 3) {\n %s = inputColor * "
+ "clamp(d, 0.0, 1.0);\n} else {\n %s = d > 0.5 ? inputColor : half4(0.0);\n}\n",
+ _sample2569.c_str(), (int)_outer.edgeType, (int)_outer.edgeType, args.fOutputColor,
+ args.fOutputColor);
}
private:
@@ -125,10 +124,7 @@
center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f);
center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f);
SkScalar radius = testData->fRandom->nextRangeF(1.f, 1000.f);
- GrClipEdgeType et;
- do {
- et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
- } while (GrClipEdgeType::kHairlineAA == et);
+ GrClipEdgeType et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
return GrCircleEffect::Make(/*inputFP=*/nullptr, et, center, radius);
}
#endif