From 8ffe0fc3825f0f6bc4d06607f6819ea8c2c2040b Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Sat, 30 Jan 2010 09:29:48 +0100 Subject: [PATCH] Revert "[quartz] Approximate dense dashing patterns" This reverts commit 27701ed8447d4c21b7bf9709a2fc21690b3cdc96. Approximation is now done in gstate. --- src/cairo-quartz-surface.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 112853610..bbfff37b3 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -2054,30 +2054,20 @@ _cairo_quartz_surface_stroke (void *abstract_surface, #define STATIC_DASH 32 float sdash[STATIC_DASH]; float *fdash = sdash; - double offset = style->dash_offset; unsigned int max_dashes = style->num_dashes; unsigned int k; - if (_cairo_stroke_style_dash_can_approximate (style, ctm, tolerance)) { - double approximate_dashes[2]; - _cairo_stroke_style_dash_approximate (style, ctm, tolerance, - &offset, - approximate_dashes, - &max_dashes); - sdash[0] = approximate_dashes[0]; - sdash[1] = approximate_dashes[1]; - } else { - if (style->num_dashes%2) - max_dashes *= 2; - if (max_dashes > STATIC_DASH) - fdash = _cairo_malloc_ab (max_dashes, sizeof (float)); - if (fdash == NULL) - return _cairo_error (CAIRO_STATUS_NO_MEMORY); + if (style->num_dashes%2) + max_dashes *= 2; + if (max_dashes > STATIC_DASH) + fdash = _cairo_malloc_ab (max_dashes, sizeof (float)); + if (fdash == NULL) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); - for (k = 0; k < max_dashes; k++) - fdash[k] = (float) style->dash[k % style->num_dashes]; - } - CGContextSetLineDash (surface->cgContext, offset, fdash, max_dashes); + for (k = 0; k < max_dashes; k++) + fdash[k] = (float) style->dash[k % style->num_dashes]; + + CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes); if (fdash != sdash) free (fdash); } else