Bug 751273 - Part 1: Remove the debugging code in Cairo which we don't use any more; r=jrmuizel

Landing on a CLOSED TREE
This commit is contained in:
Ehsan Akhgari 2012-05-02 16:28:13 -04:00
Родитель 147de6e8d8
Коммит d0be68448b
2 изменённых файлов: 0 добавлений и 83 удалений

Просмотреть файл

@ -183,26 +183,13 @@ _cairo_spline_error_squared (const cairo_spline_knots_t *knots)
return cerr;
}
void StoreSpline(int ax, int ay, int bx, int by, int cx, double cy, int dx, int dy);
void CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
static cairo_status_t
_cairo_spline_decompose_into (cairo_spline_knots_t *s1, double tolerance_squared, cairo_spline_t *result)
{
static int depth;
cairo_spline_knots_t s2;
cairo_status_t status;
depth++;
if (depth == 200) {
CrashSpline(tolerance_squared, s1->a.x, s1->a.y,
s1->b.x, s1->b.y,
s1->c.x, s1->c.y,
s1->d.x, s1->d.y);
}
if (_cairo_spline_error_squared (s1) < tolerance_squared) {
depth--;
return _cairo_spline_add_point (result, &s1->a);
}
@ -210,12 +197,10 @@ _cairo_spline_decompose_into (cairo_spline_knots_t *s1, double tolerance_squared
status = _cairo_spline_decompose_into (s1, tolerance_squared, result);
if (unlikely (status)) {
depth--;
return status;
}
status = _cairo_spline_decompose_into (&s2, tolerance_squared, result);
depth--;
return status;
}
@ -225,14 +210,6 @@ _cairo_spline_decompose (cairo_spline_t *spline, double tolerance)
cairo_spline_knots_t s1;
cairo_status_t status;
StoreSpline(spline->knots.a.x,
spline->knots.a.y,
spline->knots.b.x,
spline->knots.b.y,
spline->knots.c.x,
spline->knots.c.y,
spline->knots.d.x,
spline->knots.d.y);
s1 = spline->knots;
spline->last_point = s1.a;
status = _cairo_spline_decompose_into (&s1, tolerance * tolerance, spline);

Просмотреть файл

@ -114,66 +114,6 @@ void InitGfxDriverInfoShutdownObserver()
observerService->AddObserver(obs, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
}
extern "C" {
void StoreSpline(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
void CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
}
static int crash_ax;
static int crash_ay;
static int crash_bx;
static int crash_by;
static int crash_cx;
static int crash_cy;
static int crash_dx;
static int crash_dy;
void
StoreSpline(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
crash_ax = ax;
crash_ay = ay;
crash_bx = bx;
crash_by = by;
crash_cx = cx;
crash_cy = cy;
crash_dx = dx;
crash_dy = dy;
}
void
CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
#if defined(MOZ_CRASHREPORTER)
static bool annotated;
if (!annotated) {
nsCAutoString note;
note.AppendPrintf("curve ");
note.AppendPrintf("%x ", crash_ax);
note.AppendPrintf("%x, ", crash_ay);
note.AppendPrintf("%x ", crash_bx);
note.AppendPrintf("%x, ", crash_by);
note.AppendPrintf("%x ", crash_cx);
note.AppendPrintf("%x, ", crash_cy);
note.AppendPrintf("%x ", crash_dx);
note.AppendPrintf("%x\n", crash_dy);
note.AppendPrintf("crv-crash(%f): ", tolerance);
note.AppendPrintf("%x ", ax);
note.AppendPrintf("%x, ", ay);
note.AppendPrintf("%x ", bx);
note.AppendPrintf("%x, ", by);
note.AppendPrintf("%x ", cx);
note.AppendPrintf("%x, ", cy);
note.AppendPrintf("%x ", dx);
note.AppendPrintf("%x\n", dy);
CrashReporter::AppendAppNotesToCrashReport(note);
annotated = true;
}
#endif
}
using namespace mozilla::widget;
using namespace mozilla;