diff options
author | Uli Schlachter <psychon@znc.in> | 2017-05-13 09:37:34 +0200 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2017-05-13 09:37:34 +0200 |
commit | 9d44136ef8e2a1ad2c6631beb4bbdaeed7a2dad8 (patch) | |
tree | a10d24c1ad3eaa9716b0619ee566878df6dff500 /src/cairo-path-stroke-boxes.c | |
parent | 91b25005d62fe4ca178f45d349374e42c29a5e11 (diff) | |
download | cairo-9d44136ef8e2a1ad2c6631beb4bbdaeed7a2dad8.tar.gz |
Revert "stroker: Check for scaling overflow in computing half line widths"
This reverts commit 91b25005d62fe4ca178f45d349374e42c29a5e11 because it
causes lots of new crashes due to assertion failures.
Diffstat (limited to 'src/cairo-path-stroke-boxes.c')
-rw-r--r-- | src/cairo-path-stroke-boxes.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/cairo-path-stroke-boxes.c b/src/cairo-path-stroke-boxes.c index 9d3ffe9e3..7f25bf76c 100644 --- a/src/cairo-path-stroke-boxes.c +++ b/src/cairo-path-stroke-boxes.c @@ -98,8 +98,6 @@ _cairo_rectilinear_stroker_init (cairo_rectilinear_stroker_t *stroker, cairo_antialias_t antialias, cairo_boxes_t *boxes) { - double half_line_width; - /* This special-case rectilinear stroker only supports * miter-joined lines (not curves) and a translation-only matrix * (though it could probably be extended to support a matrix with @@ -129,22 +127,15 @@ _cairo_rectilinear_stroker_init (cairo_rectilinear_stroker_t *stroker, if (! _cairo_matrix_is_scale (ctm)) return FALSE; - half_line_width = stroke_style->line_width / 2.0; - - if (! _cairo_fixed_from_double_safe (&stroker->half_line_x, - fabs(ctm->xx) * half_line_width)) - return FALSE; - assert (stroker->half_line_x > 0); - - if (! _cairo_fixed_from_double_safe (&stroker->half_line_y, - fabs(ctm->yy) * half_line_width)) - return FALSE; - assert (stroker->half_line_y > 0); - stroker->stroke_style = stroke_style; stroker->ctm = ctm; stroker->antialias = antialias; + stroker->half_line_x = + _cairo_fixed_from_double (fabs(ctm->xx) * stroke_style->line_width / 2.0); + stroker->half_line_y = + _cairo_fixed_from_double (fabs(ctm->yy) * stroke_style->line_width / 2.0); + stroker->open_sub_path = FALSE; stroker->segments = stroker->segments_embedded; stroker->segments_size = ARRAY_LENGTH (stroker->segments_embedded); @@ -296,8 +287,6 @@ _cairo_rectilinear_stroker_emit_segments (cairo_rectilinear_stroker_t *stroker) box.p1.x = b->x; box.p2.x = a->x; } - assert (box.p1.x < box.p2.x); - if (a->y < b->y) { box.p1.y = a->y; box.p2.y = b->y; @@ -305,7 +294,6 @@ _cairo_rectilinear_stroker_emit_segments (cairo_rectilinear_stroker_t *stroker) box.p1.y = b->y; box.p2.y = a->y; } - assert (box.p1.y < box.p2.y); status = _cairo_boxes_add (stroker->boxes, stroker->antialias, &box); if (unlikely (status)) @@ -416,8 +404,6 @@ _cairo_rectilinear_stroker_emit_segments_dashed (cairo_rectilinear_stroker_t *st box.p1.x = b->x; box.p2.x = a->x; } - assert (box.p1.x < box.p2.x); - if (a->y < b->y) { box.p1.y = a->y; box.p2.y = b->y; @@ -425,7 +411,6 @@ _cairo_rectilinear_stroker_emit_segments_dashed (cairo_rectilinear_stroker_t *st box.p1.y = b->y; box.p2.y = a->y; } - assert (box.p1.y < box.p2.y); status = _cairo_boxes_add (stroker->boxes, stroker->antialias, &box); if (unlikely (status)) |