[cairo-commit] 3 commits - src/cairo-svg-surface.c test/mask-svg-argb32-ref.png test/mask-svg-rgb24-ref.png
Emmanuel Pacaud
emmanuel at kemper.freedesktop.org
Sat Nov 10 01:11:37 PST 2007
src/cairo-svg-surface.c | 29 +++++++++++++++--------------
test/mask-svg-argb32-ref.png |binary
test/mask-svg-rgb24-ref.png |binary
3 files changed, 15 insertions(+), 14 deletions(-)
New commits:
commit 8edc3ed4857795387007e7c4997f30d7ceec57ac
Merge: 3bc8a8d... 77e9b05...
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date: Sat Nov 10 10:10:50 2007 +0100
Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo
commit 3bc8a8d1d0e07e857b203a7872862437b8333b25
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date: Sat Nov 10 10:10:03 2007 +0100
[SVG] Remove spurious semicolon when emitting mask url.
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 8b2e02e..4dc672a 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -2029,7 +2029,7 @@ _cairo_svg_surface_mask (void *abstract_surface,
if (status)
return status;
- snprintf (buffer, sizeof buffer, "mask=\"url(#mask%d);\"",
+ snprintf (buffer, sizeof buffer, "mask=\"url(#mask%d)\"",
document->mask_id);
status = _cairo_svg_surface_emit_paint (surface->xml_node, surface, op, source, buffer);
if (status)
commit b68968ffd1864d591e4fc08fed55c12ece95ec55
Author: Emmanuel Pacaud <emmanuel.pacaud at free.fr>
Date: Sat Nov 10 10:07:12 2007 +0100
[SVG] Fix opacity of combined stroke and fill.
When emitting combined stroke and fill, cairo SVG backend was using the opacity
two times, instead of using fill-opacity and stroke-opacity, leading to
incorrect output.
I've updated the mask test reference images for the SVG output, since it seems
there's a bug in librsvg when fill-opacity is used in the mask image.
I've checked the SVG output with batik, and it looks fine.
diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c
index 2d1c961..8b2e02e 100644
--- a/src/cairo-svg-surface.c
+++ b/src/cairo-svg-surface.c
@@ -2,7 +2,7 @@
/* cairo - a vector graphics library with display and print output
*
* Copyright © 2004 Red Hat, Inc
- * Copyright © 2005-2006 Emmanuel Pacaud <emmanuel.pacaud at free.fr>
+ * Copyright © 2005-2007 Emmanuel Pacaud <emmanuel.pacaud at free.fr>
* Copyright © 2006 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@
*
* Contributor(s):
* Kristian Høgsberg <krh at redhat.com>
- * Emmanuel Pacaud <emmanuel.pacaud at univ-poitiers.fr>
+ * Emmanuel Pacaud <emmanuel.pacaud at free.fr>
* Carl Worth <cworth at cworth.org>
*/
@@ -1218,15 +1218,14 @@ _cairo_svg_surface_emit_operator (cairo_output_stream_t *output,
}
static cairo_status_t
-_cairo_svg_surface_emit_solid_pattern (cairo_svg_surface_t *surface,
- cairo_solid_pattern_t *pattern,
- cairo_output_stream_t *style,
- cairo_bool_t is_stroke)
-{
- _cairo_output_stream_printf (style,
- "%s: rgb(%f%%,%f%%,%f%%); "
- "opacity: %f;",
- is_stroke ? "stroke" : "fill",
+_cairo_svg_surface_emit_solid_pattern (cairo_svg_surface_t *surface,
+ cairo_solid_pattern_t *pattern,
+ cairo_output_stream_t *style,
+ cairo_bool_t is_stroke)
+{
+ _cairo_output_stream_printf (style, is_stroke ?
+ "stroke: rgb(%f%%,%f%%,%f%%); stroke-opacity: %f;":
+ "fill: rgb(%f%%,%f%%,%f%%); fill-opacity: %f;",
pattern->color.red * 100.0,
pattern->color.green * 100.0,
pattern->color.blue * 100.0,
@@ -1678,8 +1677,10 @@ _cairo_svg_surface_emit_radial_pattern (cairo_svg_surface_t *surface,
}
static cairo_status_t
-_cairo_svg_surface_emit_pattern (cairo_svg_surface_t *surface, cairo_pattern_t *pattern,
- cairo_output_stream_t *output, cairo_bool_t is_stroke)
+_cairo_svg_surface_emit_pattern (cairo_svg_surface_t *surface,
+ cairo_pattern_t *pattern,
+ cairo_output_stream_t *output,
+ cairo_bool_t is_stroke)
{
switch (pattern->type) {
case CAIRO_PATTERN_TYPE_SOLID:
diff --git a/test/mask-svg-argb32-ref.png b/test/mask-svg-argb32-ref.png
index 4a7f758..a6ad0a8 100644
Binary files a/test/mask-svg-argb32-ref.png and b/test/mask-svg-argb32-ref.png differ
diff --git a/test/mask-svg-rgb24-ref.png b/test/mask-svg-rgb24-ref.png
new file mode 100644
index 0000000..7995723
Binary files /dev/null and b/test/mask-svg-rgb24-ref.png differ
More information about the cairo-commit
mailing list