8#ifndef SkScaleToSides_DEFINED
9#define SkScaleToSides_DEFINED
29 if (*
a + *
b > limit) {
34 if (*minRadius > *maxRadius) {
36 swap(minRadius, maxRadius);
43 float newMinRadius = *minRadius;
45 float newMaxRadius = (
float)(limit - newMinRadius);
50 while (newMaxRadius + newMinRadius > limit) {
51 newMaxRadius = nextafterf(newMaxRadius, 0.0f);
53 *maxRadius = newMaxRadius;
56 SkASSERTF(*
a >= 0.0f && *
b >= 0.0f,
"a: %g, b: %g, limit: %g, scale: %g", *
a, *
b, limit,
60 "\nlimit: %.17f, sum: %.17f, a: %.10f, b: %.10f, scale: %.20f",
#define SkASSERTF(cond, fmt,...)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static void AdjustRadii(double limit, double scale, SkScalar *a, SkScalar *b)