Fix bug in cubic derivative coefficient with missing parens

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2242603002

Review-Url: https://codereview.chromium.org/2242603002
This commit is contained in:
hstern 2016-08-16 15:10:34 -07:00 committed by Commit bot
parent 087905a730
commit db085ab30f

View File

@ -106,11 +106,11 @@ ArcLengthIntegrator::ArcLengthIntegrator(const SkPoint* pts, SkSegType segType)
float Cy = pts[2].y(); float Cy = pts[2].y();
// precompute coefficients for derivative // precompute coefficients for derivative
xCoeff[0] = Sk8f(2.0f*(Ax - 2*Bx + Cx)); xCoeff[0] = Sk8f(2*(Ax - 2*Bx + Cx));
xCoeff[1] = Sk8f(2.0f*(Bx - Ax)); xCoeff[1] = Sk8f(2*(Bx - Ax));
yCoeff[0] = Sk8f(2.0f*(Ay - 2*By + Cy)); yCoeff[0] = Sk8f(2*(Ay - 2*By + Cy));
yCoeff[1] = Sk8f(2.0f*(By - Ay)); yCoeff[1] = Sk8f(2*(By - Ay));
} }
break; break;
case kCubic_SegType: case kCubic_SegType:
@ -125,13 +125,13 @@ ArcLengthIntegrator::ArcLengthIntegrator(const SkPoint* pts, SkSegType segType)
float Dy = pts[3].y(); float Dy = pts[3].y();
// precompute coefficients for derivative // precompute coefficients for derivative
xCoeff[0] = Sk8f(3.0f*(-Ax + 3.0f*(Bx - Cx) + Dx)); xCoeff[0] = Sk8f(3*(-Ax + 3*(Bx - Cx) + Dx));
xCoeff[1] = Sk8f(3.0f*(2.0f*(Ax - 2.0f*Bx + Cx))); xCoeff[1] = Sk8f(6*(Ax - 2*Bx + Cx));
xCoeff[2] = Sk8f(3.0f*(-Ax + Bx)); xCoeff[2] = Sk8f(3*(-Ax + Bx));
yCoeff[0] = Sk8f(3.0f*(-Ay + 3.0f*(By - Cy) + Dy)); yCoeff[0] = Sk8f(3*(-Ay + 3*(By - Cy) + Dy));
yCoeff[1] = Sk8f(3.0f * -Ay + By + 2.0f*(Ay - 2.0f*By + Cy)); yCoeff[1] = Sk8f(6*(Ay - 2*By + Cy));
yCoeff[2] = Sk8f(3.0f*(-Ay + By)); yCoeff[2] = Sk8f(3*(-Ay + By));
} }
break; break;
case kConic_SegType: case kConic_SegType: