Bug 1278512 - Fix bezier flattening when the inflection points are on the extremity of the curve. r=Bas
authorNicolas Silva <nsilva@mozilla.com>
Tue, 07 Jun 2016 16:51:44 +0200
changeset 300878 0e31bd18b553a580eff969f29a4a9a2d5e0f615a
parent 300877 a607886f98ae6b6755fd4c1b3f03b14a5a8d2ad7
child 300879 c9feae2dd586b64420a416b77d6fc4e59fe7c904
push id78115
push usernsilva@mozilla.com
push dateTue, 07 Jun 2016 14:51:57 +0000
treeherdermozilla-inbound@0e31bd18b553 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1278512
milestone50.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 1278512 - Fix bezier flattening when the inflection points are on the extremity of the curve. r=Bas
gfx/2d/Path.cpp
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -452,17 +452,17 @@ FlattenBezier(const BezierControlPoints 
 {
   double t1;
   double t2;
   uint32_t count;
 
   FindInflectionPoints(aControlPoints, &t1, &t2, &count);
 
   // Check that at least one of the inflection points is inside [0..1]
-  if (count == 0 || ((t1 < 0 || t1 > 1.0) && (count == 1 || (t2 < 0 || t2 > 1.0))) ) {
+  if (count == 0 || ((t1 <= 0.0 || t1 >= 1.0) && (count == 1 || (t2 <= 0.0 || t2 >= 1.0))) ) {
     FlattenBezierCurveSegment(aControlPoints, aSink, aTolerance);
     return;
   }
 
   double t1min = t1, t1max = t1, t2min = t2, t2max = t2;
 
   BezierControlPoints remainingCP = aControlPoints;