diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/cairo/dasharray-zero-gap.patch | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/cairo/dasharray-zero-gap.patch')
-rw-r--r-- | gfx/cairo/dasharray-zero-gap.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gfx/cairo/dasharray-zero-gap.patch b/gfx/cairo/dasharray-zero-gap.patch new file mode 100644 index 0000000000..e26580ae14 --- /dev/null +++ b/gfx/cairo/dasharray-zero-gap.patch @@ -0,0 +1,60 @@ +diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c +--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c ++++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c +@@ -2573,29 +2573,43 @@ static cairo_int_status_t + + if (style->dash && style->num_dashes) { + #define STATIC_DASH 32 + cairo_quartz_float_t sdash[STATIC_DASH]; + cairo_quartz_float_t *fdash = sdash; + unsigned int max_dashes = style->num_dashes; + unsigned int k; + +- if (style->num_dashes%2) +- max_dashes *= 2; +- if (max_dashes > STATIC_DASH) +- fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t)); +- if (fdash == NULL) +- return _cairo_error (CAIRO_STATUS_NO_MEMORY); +- +- for (k = 0; k < max_dashes; k++) +- fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes]; +- +- CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes); +- if (fdash != sdash) +- free (fdash); ++ bool set_line_dash = false; ++ if (style->num_dashes % 2 == 0) { ++ for (k = 1; k < max_dashes; k++) { ++ if (style->dash[k]) { ++ set_line_dash = true; ++ break; ++ } ++ } ++ } else ++ set_line_dash = true; ++ ++ if (set_line_dash) { ++ if (style->num_dashes%2) ++ max_dashes *= 2; ++ if (max_dashes > STATIC_DASH) ++ fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t)); ++ if (fdash == NULL) ++ return _cairo_error (CAIRO_STATUS_NO_MEMORY); ++ ++ for (k = 0; k < max_dashes; k++) ++ fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes]; ++ ++ CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes); ++ if (fdash != sdash) ++ free (fdash); ++ } else ++ CGContextSetLineDash (state.context, 0, NULL, 0); + } else + CGContextSetLineDash (state.context, 0, NULL, 0); + + + _cairo_quartz_cairo_path_to_quartz_context (path, state.context); + + _cairo_quartz_cairo_matrix_to_quartz (ctm, &strokeTransform); + CGContextConcatCTM (state.context, strokeTransform); |