Commit 7f0f0802 authored by Adrian Johnson's avatar Adrian Johnson Committed by Carlos Garcia Campos

cairo: fix stroke pattern with transparency group

Cairo copy path/append path with device offsets is broken. Use GfxPath
instead.

Bug 48468
parent 5ea305c3
......@@ -776,7 +776,7 @@ void CairoOutputDev::fill(GfxState *state) {
cairo_mask (cairo, mask);
cairo_restore (cairo);
} else if (strokePathClip) {
fillToStrokePathClip();
fillToStrokePathClip(state);
} else {
cairo_fill (cairo);
}
......@@ -865,7 +865,7 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *cat
cairo_set_source (cairo, pattern);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
if (strokePathClip) {
fillToStrokePathClip();
fillToStrokePathClip(state);
} else {
cairo_fill (cairo);
}
......@@ -1100,8 +1100,7 @@ void CairoOutputDev::eoClip(GfxState *state) {
void CairoOutputDev::clipToStrokePath(GfxState *state) {
LOG(printf("clip-to-stroke-path\n"));
strokePathClip = (StrokePathClip*)gmalloc (sizeof(*strokePathClip));
doPath (cairo, state, state->getPath());
strokePathClip->path = cairo_copy_path (cairo);
strokePathClip->path = state->getPath()->copy();
cairo_get_matrix (cairo, &strokePathClip->ctm);
strokePathClip->line_width = cairo_get_line_width (cairo);
strokePathClip->dash_count = cairo_get_dash_count (cairo);
......@@ -1116,7 +1115,7 @@ void CairoOutputDev::clipToStrokePath(GfxState *state) {
strokePathClip->miter = cairo_get_miter_limit (cairo);
}
void CairoOutputDev::fillToStrokePathClip() {
void CairoOutputDev::fillToStrokePathClip(GfxState *state) {
cairo_save (cairo);
cairo_set_matrix (cairo, &strokePathClip->ctm);
......@@ -1126,14 +1125,12 @@ void CairoOutputDev::fillToStrokePathClip() {
cairo_set_line_cap (cairo, strokePathClip->cap);
cairo_set_line_join (cairo, strokePathClip->join);
cairo_set_miter_limit (cairo, strokePathClip->miter);
cairo_new_path (cairo);
cairo_append_path (cairo, strokePathClip->path);
doPath (cairo, state, strokePathClip->path);
cairo_stroke (cairo);
cairo_restore (cairo);
cairo_path_destroy (strokePathClip->path);
delete strokePathClip->path;
if (strokePathClip->dashes)
gfree (strokePathClip->dashes);
gfree (strokePathClip);
......
......@@ -273,7 +273,7 @@ protected:
GBool interpolate);
GBool getStreamData (Stream *str, char **buffer, int *length);
void setMimeData(Stream *str, Object *ref, cairo_surface_t *image);
void fillToStrokePathClip();
void fillToStrokePathClip(GfxState *state);
void alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y);
GfxRGB fill_color, stroke_color;
......@@ -286,7 +286,7 @@ protected:
CairoFont *currentFont;
struct StrokePathClip {
cairo_path_t *path;
GfxPath *path;
cairo_matrix_t ctm;
double line_width;
double *dashes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment