Bug 999943: Correctly use the absolute value to determine min and max of the inflection range. r=jwatt
authorBas Schouten <bschouten@mozilla.com>
Tue, 27 May 2014 17:03:34 +0200
changeset 185154 0acfd585d47ccea35ad3ff3815b112b3bd89a2dc
parent 185153 1b76d9de26129d794cbc4c7ff623f3a555e648b4
child 185155 77cb01391beffb1e271681d6a6c684096a2009df
push id26844
push userryanvm@gmail.com
push dateTue, 27 May 2014 20:23:53 +0000
treeherdermozilla-central@448f2153d6d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs999943
milestone32.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 999943: Correctly use the absolute value to determine min and max of the inflection range. r=jwatt
gfx/2d/Path.cpp
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -273,18 +273,18 @@ FindInflectionApproximationRange(BezierC
 {
     SplitBezier(aControlPoints, nullptr, &aControlPoints, aT);
 
     Point cp21 = aControlPoints.mCP2 - aControlPoints.mCP1;
     Point cp41 = aControlPoints.mCP4 - aControlPoints.mCP1;
 
     if (cp21.x == 0 && cp21.y == 0) {
       // In this case s3 becomes lim[n->0] (cp41.x * n) / n - (cp41.y * n) / n = cp41.x - cp41.y.
-      *aMin = aT - CubicRoot(double(aTolerance / (cp41.x - cp41.y)));
-      *aMax = aT + CubicRoot(aTolerance / (cp41.x - cp41.y));
+      *aMin = aT - CubicRoot(abs(aTolerance / (cp41.x - cp41.y)));
+      *aMax = aT + CubicRoot(abs(aTolerance / (cp41.x - cp41.y)));
       return;
     }
 
     Float s3 = (cp41.x * cp21.y - cp41.y * cp21.x) / hypotf(cp21.x, cp21.y);
 
     if (s3 == 0) {
       // This means within the precision we have it can be approximated
       // infinitely by a linear segment. Deal with this by specifying the