Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: src/utils/SkCurveMeasure.cpp

Issue 2242603002: Fix bug in cubic derivative coefficient with missing parens (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove extra .0f. Also 2*3 = 6 Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkCurveMeasure.cpp
diff --git a/src/utils/SkCurveMeasure.cpp b/src/utils/SkCurveMeasure.cpp
index 60fbf34ff24be9d78085f7333e4a74db0ae2b07b..a82008e67e25a47460b5129a6e7f1598a701ea04 100644
--- a/src/utils/SkCurveMeasure.cpp
+++ b/src/utils/SkCurveMeasure.cpp
@@ -106,11 +106,11 @@ ArcLengthIntegrator::ArcLengthIntegrator(const SkPoint* pts, SkSegType segType)
float Cy = pts[2].y();
// precompute coefficients for derivative
- xCoeff[0] = Sk8f(2.0f*(Ax - 2*Bx + Cx));
- xCoeff[1] = Sk8f(2.0f*(Bx - Ax));
+ xCoeff[0] = Sk8f(2*(Ax - 2*Bx + Cx));
+ xCoeff[1] = Sk8f(2*(Bx - Ax));
- yCoeff[0] = Sk8f(2.0f*(Ay - 2*By + Cy));
- yCoeff[1] = Sk8f(2.0f*(By - Ay));
+ yCoeff[0] = Sk8f(2*(Ay - 2*By + Cy));
+ yCoeff[1] = Sk8f(2*(By - Ay));
}
break;
case kCubic_SegType:
@@ -125,13 +125,13 @@ ArcLengthIntegrator::ArcLengthIntegrator(const SkPoint* pts, SkSegType segType)
float Dy = pts[3].y();
// precompute coefficients for derivative
- xCoeff[0] = Sk8f(3.0f*(-Ax + 3.0f*(Bx - Cx) + Dx));
- xCoeff[1] = Sk8f(3.0f*(2.0f*(Ax - 2.0f*Bx + Cx)));
- xCoeff[2] = Sk8f(3.0f*(-Ax + Bx));
+ xCoeff[0] = Sk8f(3*(-Ax + 3*(Bx - Cx) + Dx));
+ xCoeff[1] = Sk8f(6*(Ax - 2*Bx + Cx));
+ xCoeff[2] = Sk8f(3*(-Ax + Bx));
- yCoeff[0] = Sk8f(3.0f*(-Ay + 3.0f*(By - Cy) + Dy));
- yCoeff[1] = Sk8f(3.0f * -Ay + By + 2.0f*(Ay - 2.0f*By + Cy));
- yCoeff[2] = Sk8f(3.0f*(-Ay + By));
+ yCoeff[0] = Sk8f(3*(-Ay + 3*(By - Cy) + Dy));
+ yCoeff[1] = Sk8f(6*(Ay - 2*By + Cy));
+ yCoeff[2] = Sk8f(3*(-Ay + By));
}
break;
case kConic_SegType:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698