[poppler] poppler/CairoOutputDev.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Tue Apr 6 03:33:28 PDT 2010
poppler/CairoOutputDev.cc | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
New commits:
commit 1422802f029483ad3e62a3a13e66b2d3990ac58f
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Tue Apr 6 12:32:12 2010 +0200
[cairo] Use current fill_opacity when drawing soft masked images
Fixes GNOME Bug https://bugzilla.gnome.org/show_bug.cgi?id=614915
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index c433fdb..cf0b31c 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -2140,19 +2140,32 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
cairo_matrix_scale (&maskMatrix, maskWidth, -maskHeight);
cairo_pattern_set_matrix (maskPattern, &maskMatrix);
- if (!printing) {
+ if (fill_opacity != 1.0)
+ cairo_push_group (cairo);
+ else
cairo_save (cairo);
- cairo_set_source (cairo, pattern);
+
+ cairo_set_source (cairo, pattern);
+ if (!printing) {
cairo_rectangle (cairo, 0., 0.,
MIN (width, maskWidth) / (double)width,
MIN (height, maskHeight) / (double)height);
cairo_clip (cairo);
- cairo_mask (cairo, maskPattern);
- cairo_restore (cairo);
- } else {
- cairo_set_source (cairo, pattern);
- cairo_mask (cairo, maskPattern);
}
+ cairo_mask (cairo, maskPattern);
+
+ if (fill_opacity != 1.0) {
+ cairo_pop_group_to_source (cairo);
+ cairo_save (cairo);
+ if (!printing) {
+ cairo_rectangle (cairo, 0., 0.,
+ MIN (width, maskWidth) / (double)width,
+ MIN (height, maskHeight) / (double)height);
+ cairo_clip (cairo);
+ }
+ cairo_paint_with_alpha (cairo, fill_opacity);
+ }
+ cairo_restore (cairo);
if (cairo_shape) {
cairo_save (cairo_shape);
More information about the poppler
mailing list