From a590a40cc8cf8740392e77a046f7c2c8967d1c03 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Mon, 16 Jan 2012 21:25:19 +1030 Subject: [PATCH] cairo: ensure paintTransparencyGroup uses same ctm as beginTransparencyGroup Bug 29968 --- poppler/CairoOutputDev.cc | 8 ++++++-- poppler/CairoOutputDev.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index db7e654..051f5d0 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1396,6 +1396,7 @@ void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, double * /*bbo ColorSpaceStack* css = new ColorSpaceStack; css->cs = blendingColorSpace; css->knockout = knockout; + cairo_get_matrix(cairo, &css->group_matrix); css->next = groupColorSpaceStack; groupColorSpaceStack = css; @@ -1452,10 +1453,12 @@ void CairoOutputDev::endTransparencyGroup(GfxState * /*state*/) { } void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) { - cairo_set_source (cairo, group); - LOG(printf ("paint transparency group\n")); + cairo_save (cairo); + cairo_set_matrix (cairo, &groupColorSpaceStack->group_matrix); + cairo_set_source (cairo, group); + if (!mask) { //XXX: deal with mask && shape case if (shape) { @@ -1495,6 +1498,7 @@ void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbo } popTransparencyGroup(); + cairo_restore(cairo); } static int luminocity(uint32_t x) diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h index 949d459..b2e6fb2 100644 --- a/poppler/CairoOutputDev.h +++ b/poppler/CairoOutputDev.h @@ -348,6 +348,7 @@ protected: struct ColorSpaceStack { GBool knockout; GfxColorSpace *cs; + cairo_matrix_t group_matrix; struct ColorSpaceStack *next; } * groupColorSpaceStack; -- 1.7.5.4