Bug 1276068 - Correct the path flatness estimation computation. r=Bas
authorNicolas Silva <nsilva@mozilla.com>
Tue, 31 May 2016 12:34:17 +0200
changeset 299599 e33ed35dc9d98edf37f557fb24f9407522ab8a55
parent 299598 37c7fec8a0c130033c7e8462b058ea360c6d36d9
child 299600 b797131df3546a1b604e6da0f3283fdfdf1d5197
push id77645
push usernsilva@mozilla.com
push dateTue, 31 May 2016 10:34:34 +0000
treeherdermozilla-inbound@e33ed35dc9d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1276068
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276068 - Correct the path flatness estimation computation. r=Bas
gfx/2d/Path.cpp
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -254,17 +254,17 @@ FlattenBezierCurveSegment(const BezierCo
    * equation of a cubic bezier curve is insignificantly small. This can
    * then be approximated by a quadratic equation for which the maximum
    * difference from a linear approximation can be much more easily determined.
    */
   BezierControlPoints currentCP = aControlPoints;
 
   double t = 0;
   while (t < 1.0) {
-    PointD cp21 = currentCP.mCP2 - currentCP.mCP3;
+    PointD cp21 = currentCP.mCP2 - currentCP.mCP1;
     PointD cp31 = currentCP.mCP3 - currentCP.mCP1;
 
     /* To remove divisions and check for divide-by-zero, this is optimized from:
      * Float s3 = (cp31.x * cp21.y - cp31.y * cp21.x) / hypotf(cp21.x, cp21.y);
      * t = 2 * Float(sqrt(aTolerance / (3. * std::abs(s3))));
      */
     double cp21x31 = cp31.x * cp21.y - cp31.y * cp21.x;
     double h = hypot(cp21.x, cp21.y);