aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrCircleEffect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/GrCircleEffect.cpp')
-rw-r--r--src/gpu/effects/GrCircleEffect.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/effects/GrCircleEffect.cpp b/src/gpu/effects/GrCircleEffect.cpp
index 3bd2138e94..a5adf1cc88 100644
--- a/src/gpu/effects/GrCircleEffect.cpp
+++ b/src/gpu/effects/GrCircleEffect.cpp
@@ -66,6 +66,9 @@ private:
SkScalar effectiveRadius = radius;
if (GrProcessorEdgeTypeIsInverseFill((GrClipEdgeType)edgeType)) {
effectiveRadius -= 0.5f;
+ // When the radius is 0.5 effectiveRadius is 0 which causes an inf * 0 in the
+ // shader.
+ effectiveRadius = SkTMax(0.001f, effectiveRadius);
} else {
effectiveRadius += 0.5f;
}
@@ -108,7 +111,7 @@ std::unique_ptr<GrFragmentProcessor> GrCircleEffect::TestCreate(GrProcessorTestD
SkPoint center;
center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f);
center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f);
- SkScalar radius = testData->fRandom->nextRangeF(0.f, 1000.f);
+ SkScalar radius = testData->fRandom->nextRangeF(1.f, 1000.f);
GrClipEdgeType et;
do {
et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);