Bug 626994. Fix the depth counting. r=ehsan a=joe (landing on the beta11 release branch) GECKO20b11_2011020209_RELBRANCH
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 02 Feb 2011 13:47:12 -0500
branchGECKO20b11_2011020209_RELBRANCH
changeset 61802 36f4e8a8b953e9b8ce54b0e3c8ded5edba56753e
parent 61788 fe971e94722f3d8f14b70b572a4270be6d7f23b8
child 61806 49c3ca45a79ffdd33f0573dfa98c7d63643f907b
push id18495
push usereakhgari@mozilla.com
push dateWed, 02 Feb 2011 20:53:46 +0000
treeherdermozilla-central@36f4e8a8b953 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, joe
bugs626994
milestone2.0b11
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 626994. Fix the depth counting. r=ehsan a=joe (landing on the beta11 release branch) Previously we missed a decrement at the end of the recursion. This caused us to accumulate over time, causing us to misreport.
gfx/cairo/cairo/src/cairo-spline.c
--- a/gfx/cairo/cairo/src/cairo-spline.c
+++ b/gfx/cairo/cairo/src/cairo-spline.c
@@ -195,24 +195,28 @@ static cairo_status_t
 
     depth++;
 #ifdef MOZ_ENABLE_LIBXUL
     if (depth == 200) {
         CrashSpline();
     }
 #endif
 
-    if (_cairo_spline_error_squared (s1) < tolerance_squared)
+    if (_cairo_spline_error_squared (s1) < tolerance_squared) {
+        depth--;
 	return _cairo_spline_add_point (result, &s1->a);
+    }
 
     _de_casteljau (s1, &s2);
 
     status = _cairo_spline_decompose_into (s1, tolerance_squared, result);
-    if (unlikely (status))
+    if (unlikely (status)) {
+        depth--;
 	return status;
+    }
 
     status = _cairo_spline_decompose_into (&s2, tolerance_squared, result);
     depth--;
     return status;
 }
 
 cairo_status_t
 _cairo_spline_decompose (cairo_spline_t *spline, double tolerance)