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 300918 0e31bd18b553a580eff969f29a4a9a2d5e0f615a
parent 300917 a607886f98ae6b6755fd4c1b3f03b14a5a8d2ad7
child 300919 c9feae2dd586b64420a416b77d6fc4e59fe7c904
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs1278512
milestone50.0a1
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;