From cd96d9d487af0e50212a2db7de150e178fc5cffe Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Mon, 9 Apr 2012 17:17:29 +0930 Subject: [PATCH] cairo: fix paintTransparencyGroup when both mask and fill opacity are required Bug 48453 --- poppler/CairoOutputDev.cc | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index e9b836f..8ea4129 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1502,11 +1502,17 @@ void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbo if (status) printf("BAD status: %s\n", cairo_status_to_string(status)); } else { + if (fill_opacity < 1.0) { + cairo_push_group(cairo); + } cairo_save(cairo); cairo_set_matrix(cairo, &mask_matrix); cairo_mask(cairo, mask); cairo_restore(cairo); - + if (fill_opacity < 1.0) { + cairo_pop_group_to_source(cairo); + cairo_paint_with_alpha (cairo, fill_opacity); + } cairo_pattern_destroy(mask); mask = NULL; } -- 1.7.5.4