Change-Id: Id0db49ad45b341d39abf7ee532ecc0799a832192
Reviewed-on: https://skia-review.googlesource.com/8079
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
SkScalar hh = h / 2.f;
SkScalar umbraInsetX = s * hw + factory.fRadius;
SkScalar umbraInsetY = s * hh + factory.fRadius;
+ // The umbra is inset by radius along the diagonal, so adjust for that.
+ SkScalar d = 1.f / SkScalarSqrt(hw * hw + hh * hh);
+ umbraInsetX *= hw * d;
+ umbraInsetY *= hh * d;
if (umbraInsetX > hw || umbraInsetY > hh) {
// There is no umbra to occlude.
factory.fOccluderType = SpotVerticesFactory::OccluderType::kTransparent;