aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 10159bba77..9dc1c91e5b 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -195,12 +195,15 @@ private:
}
fragBuilder->codeAppend("edgeAlpha *= clip;");
if (cgp.fInRoundCapCenters) {
+ // We compute coverage of the round caps as circles at the butt caps produced
+ // by the clip planes. The inverse of the clip planes is applied so that there
+ // is no double counting.
fragBuilder->codeAppendf(
"half dcap1 = circleEdge.z * (%s - length(circleEdge.xy - "
" roundCapCenters.xy));"
"half dcap2 = circleEdge.z * (%s - length(circleEdge.xy - "
" roundCapCenters.zw));"
- "half capAlpha = max(dcap1, 0) + max(dcap2, 0);"
+ "half capAlpha = (1 - clip) * (max(dcap1, 0) + max(dcap2, 0));"
"edgeAlpha = min(edgeAlpha + capAlpha, 1.0);",
capRadius.fsIn(), capRadius.fsIn());
}