From c4697bc572f60340978df6662caad0e0755acc58 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 7 Mar 2005 14:23:07 +0000 Subject: [PATCH] Disable the "new" intersection code so that the incorrect fill problems (test/fill_rule) go away. --- ChangeLog | 3 +++ src/cairo-traps.c | 28 ++++++++++++++++++++++++++-- src/cairo_traps.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 426b41413..e538ba90b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-03-07 Carl Worth + * src/cairo_traps.c: Disable the "new" intersection code so that + the incorrect fill problems (test/fill_rule) go away. + * configure.in: Make configure fail if no font backend is available. Point the user at freetype and fontconfig. diff --git a/src/cairo-traps.c b/src/cairo-traps.c index dbb23f838..79c7e16b6 100644 --- a/src/cairo-traps.c +++ b/src/cairo-traps.c @@ -359,6 +359,29 @@ _compare_cairo_edge_by_current_x_slope (const void *av, const void *bv) doesn't matter much anyway). */ +/* XXX: Keith's new intersection code is much cleaner, and uses + * sufficient precision for correctly sorting intersections according + * to the analysis in Hobby's paper. + * + * But, when we enable this code, some things are failing, (eg. the + * stars in test/fill_rule get filled wrong). This could indicate a + * bug in one of tree places: + * + * 1) The new intersection code in this file + * + * 2) cairo_wideint.c (which is only exercised here) + * + * 3) In the current tessellator, (where the old intersection + * code, with its mystic increments could be masking the bug). + * + * It will likely be easier to revisit this when the new tessellation + * code is in place. So, for now, we'll simply disable the new + * intersection code. + */ + +#define CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE 0 + +#if CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE static const cairo_fixed_32_32_t _det16_32 (cairo_fixed_16_16_t a, cairo_fixed_16_16_t b, @@ -458,6 +481,7 @@ _line_segs_intersect_ceil (cairo_line_t *l1, cairo_line_t *l2, cairo_fixed_t *y_ return 1; } +#endif /* CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE */ static cairo_fixed_16_16_t _compute_x (cairo_line_t *line, cairo_fixed_t y) @@ -469,7 +493,7 @@ _compute_x (cairo_line_t *line, cairo_fixed_t y) return line->p1.x + (ex / dy); } -#if 0 +#if ! CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE static double _compute_inverse_slope (cairo_line_t *l) { @@ -559,7 +583,7 @@ _line_segs_intersect_ceil (cairo_line_t *l1, cairo_line_t *l2, cairo_fixed_t *y_ return 1; } -#endif +#endif /* CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE */ /* The algorithm here is pretty simple: diff --git a/src/cairo_traps.c b/src/cairo_traps.c index dbb23f838..79c7e16b6 100644 --- a/src/cairo_traps.c +++ b/src/cairo_traps.c @@ -359,6 +359,29 @@ _compare_cairo_edge_by_current_x_slope (const void *av, const void *bv) doesn't matter much anyway). */ +/* XXX: Keith's new intersection code is much cleaner, and uses + * sufficient precision for correctly sorting intersections according + * to the analysis in Hobby's paper. + * + * But, when we enable this code, some things are failing, (eg. the + * stars in test/fill_rule get filled wrong). This could indicate a + * bug in one of tree places: + * + * 1) The new intersection code in this file + * + * 2) cairo_wideint.c (which is only exercised here) + * + * 3) In the current tessellator, (where the old intersection + * code, with its mystic increments could be masking the bug). + * + * It will likely be easier to revisit this when the new tessellation + * code is in place. So, for now, we'll simply disable the new + * intersection code. + */ + +#define CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE 0 + +#if CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE static const cairo_fixed_32_32_t _det16_32 (cairo_fixed_16_16_t a, cairo_fixed_16_16_t b, @@ -458,6 +481,7 @@ _line_segs_intersect_ceil (cairo_line_t *l1, cairo_line_t *l2, cairo_fixed_t *y_ return 1; } +#endif /* CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE */ static cairo_fixed_16_16_t _compute_x (cairo_line_t *line, cairo_fixed_t y) @@ -469,7 +493,7 @@ _compute_x (cairo_line_t *line, cairo_fixed_t y) return line->p1.x + (ex / dy); } -#if 0 +#if ! CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE static double _compute_inverse_slope (cairo_line_t *l) { @@ -559,7 +583,7 @@ _line_segs_intersect_ceil (cairo_line_t *l1, cairo_line_t *l2, cairo_fixed_t *y_ return 1; } -#endif +#endif /* CAIRO_TRAPS_USE_NEW_INTERSECTION_CODE */ /* The algorithm here is pretty simple: