summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-08-28 17:52:11 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-08-28 17:53:09 +0000
commit1e31c41a0ef4b0f383d4f9d2941f643ae67ca646 (patch)
tree8e88341a2dca88abb844b3c46edee3f8b79ff2e8 /src
parentFix rendering when a <tspan> has a CSS 'display' property with value 'none'. (diff)
downloadinkscape-1e31c41a0ef4b0f383d4f9d2941f643ae67ca646.tar.gz
inkscape-1e31c41a0ef4b0f383d4f9d2941f643ae67ca646.zip
Fix opacity of rasterized filters in PDF export
Opacity was applied thrice: 1. when rendering the filter to a pixbuf (i.e. transparency was baked into the bitmap) 2. when rendering this pixbuf onto a cairo surface 3. when actually rendering the (now doubly opaque) item Avoid 1. and 2. and only apply opacity once. Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/381677
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/cairo-renderer.cpp2
-rw-r--r--src/helper/pixbuf-ops.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index b21505431..71bda6bbc 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -523,7 +523,9 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
if (pb) {
//TEST(gdk_pixbuf_save( pb, "bitmap.png", "png", NULL, NULL ));
+ ctx->pushState();
ctx->renderImage(pb.get(), t, item->style);
+ ctx->popState();
}
}
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp
index 947af3b50..a79efdbdd 100644
--- a/src/helper/pixbuf-ops.cpp
+++ b/src/helper/pixbuf-ops.cpp
@@ -131,6 +131,9 @@ Inkscape::Pixbuf *sp_generate_internal_bitmap(SPDocument *doc, gchar const */*fi
// because that would not work if the shown item references something in defs
if (item_only) {
hide_other_items_recursively(doc->getRoot(), item_only, dkey);
+ // TODO: The following line forces 100% opacity as required by sp_asbitmap_render() in cairo-renderer.cpp
+ // Make it contitional if 'item_only' is ever used by other callers which need to retain opacity
+ item_only->get_arenaitem(dkey)->setOpacity(1.0);
}
Geom::IntRect final_bbox = Geom::IntRect::from_xywh(0, 0, width, height);