? mkinstalldirs Index: poppler/CairoOutputDev.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.cc,v retrieving revision 1.48 diff -u -r1.48 CairoOutputDev.cc --- poppler/CairoOutputDev.cc 21 Dec 2006 01:01:30 -0000 1.48 +++ poppler/CairoOutputDev.cc 28 Jul 2007 16:10:34 -0000 @@ -491,6 +491,51 @@ } +cairo_pattern_t *group; +cairo_pattern_t *mask; +void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/, + GfxColorSpace * /*blendingColorSpace*/, + GBool /*isolated*/, GBool /*knockout*/, + GBool forSoftMask) { + printf("push group\n"); + if (0 && forSoftMask) + cairo_push_group_with_content (cairo, CAIRO_CONTENT_ALPHA); + else + cairo_push_group (cairo); +} +void CairoOutputDev::endTransparencyGroup(GfxState * /*state*/) { + printf("pop group\n"); + group = cairo_pop_group (cairo); +} +void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) { + cairo_set_source (cairo, group); + if (!mask) { + printf("paint group: %g\n", fill_opacity); + static int count; + //if (count++) + cairo_paint_with_alpha (cairo, fill_opacity); + } else { + printf("paint group w/ mask\n"); + //cairo_set_source_rgb(cairo, 1.0, 0, 0); + cairo_set_source (cairo, mask); + cairo_paint(cairo); + mask = NULL; + } +} + +void CairoOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool alpha, + Function * /*transferFunc*/, GfxColor * /*backdropColor*/) { + printf("set soft mask\n"); + //XXX we don't proplery deal with luminocity (e.g. alpha = false) masks + cairo_set_source (cairo, group); + mask = group; + //cairo_paint (cairo); +} + +void CairoOutputDev::clearSoftMask(GfxState * /*state*/) { + printf("clear soft mask\n"); + //mask = NULL; +} void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, Index: poppler/CairoOutputDev.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.h,v retrieving revision 1.17 diff -u -r1.17 CairoOutputDev.h --- poppler/CairoOutputDev.h 31 May 2006 17:31:49 -0000 1.17 +++ poppler/CairoOutputDev.h 28 Jul 2007 16:10:34 -0000 @@ -133,10 +133,21 @@ GBool maskInvert); + //----- transparency groups and soft masks + virtual void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/, + GfxColorSpace * /*blendingColorSpace*/, + GBool /*isolated*/, GBool /*knockout*/, + GBool /*forSoftMask*/); + virtual void endTransparencyGroup(GfxState * /*state*/); + virtual void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/); + virtual void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/, + Function * /*transferFunc*/, GfxColor * /*backdropColor*/); + virtual void clearSoftMask(GfxState * /*state*/); + //----- Type 3 font operators virtual void type3D0(GfxState *state, double wx, double wy); virtual void type3D1(GfxState *state, double wx, double wy, - double llx, double lly, double urx, double ury); + double llx, double lly, double urx, double ury); //----- special access