diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-05-16 22:29:27 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 23:47:14 +0100 |
commit | 93bd1ff05bf315ed11b305d32eb510bd9a9a7e92 (patch) | |
tree | 10c2d846ed1193624a5119853bbc2ef9651e197c /fitz/dev_svg.c | |
parent | 558ad511446cfa1d70891d9e7c9fb1ba942d3d9a (diff) | |
download | mupdf-93bd1ff05bf315ed11b305d32eb510bd9a9a7e92.tar.xz |
Add colorspace context.
To prepare for color management, we have to make the device colorspaces
per-context and able to be overridden by users.
Diffstat (limited to 'fitz/dev_svg.c')
-rw-r--r-- | fitz/dev_svg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fitz/dev_svg.c b/fitz/dev_svg.c index 1b71e576..4353544d 100644 --- a/fitz/dev_svg.c +++ b/fitz/dev_svg.c @@ -112,7 +112,7 @@ svg_dev_fill_color(svg_device *sdev, fz_colorspace *colorspace, float *color, fl fz_output *out = sdev->out; float rgb[FZ_MAX_COLORS]; - if (colorspace != fz_device_rgb) + if (colorspace != fz_device_rgb(ctx)) { /* If it's not rgb, make it rgb */ colorspace->to_rgb(ctx, colorspace, color, rgb); @@ -136,7 +136,7 @@ svg_dev_stroke_color(svg_device *sdev, fz_colorspace *colorspace, float *color, fz_output *out = sdev->out; float rgb[FZ_MAX_COLORS]; - if (colorspace != fz_device_rgb) + if (colorspace != fz_device_rgb(ctx)) { /* If it's not rgb, make it rgb */ colorspace->to_rgb(ctx, colorspace, color, rgb); @@ -273,7 +273,7 @@ svg_dev_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_ fz_printf(out, "<path"); svg_dev_ctm(sdev, ctm); svg_dev_stroke_state(sdev, stroke); - svg_dev_stroke_color(sdev, fz_device_rgb, white, 1); + svg_dev_stroke_color(sdev, fz_device_rgb(ctx), white, 1); svg_dev_path(sdev, path); fz_printf(out, "/>\n</mask>\n<g mask=\"url(#ma%d)\">\n", num); } @@ -319,7 +319,7 @@ svg_dev_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accum fz_printf(out, "<mask id=\"ma%d\" x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" maskUnits=\"userSpaceOnUse\" maskContentUnits=\"userSpaceOnUse\" >\n", num, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0); fz_printf(out, "<text"); - svg_dev_fill_color(sdev, fz_device_rgb, white, 1.0f); + svg_dev_fill_color(sdev, fz_device_rgb(ctx), white, 1.0f); svg_dev_text(sdev, ctm, text); fz_printf(out, "</mask>\n<g mask=\"url(#ma%d)\">\n", num); } @@ -340,7 +340,7 @@ svg_dev_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, num, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0); fz_printf(out, "<text"); svg_dev_stroke_state(sdev, stroke); - svg_dev_stroke_color(sdev, fz_device_rgb, white, 1.0f); + svg_dev_stroke_color(sdev, fz_device_rgb(ctx), white, 1.0f); svg_dev_text(sdev, ctm, text); fz_printf(out, "</mask>\n<g mask=\"url(#ma%d)\">\n", num); } |