From b3c3a691bfb5d1d06c086744f1ba7d8061379772 Mon Sep 17 00:00:00 2001 From: kramm Date: Wed, 19 Mar 2008 21:48:45 +0000 Subject: [PATCH] fixed crash and offset error in transparency groups --- lib/pdf/BitmapOutputDev.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc index 061e8ae..d0dafa8 100644 --- a/lib/pdf/BitmapOutputDev.cc +++ b/lib/pdf/BitmapOutputDev.cc @@ -617,7 +617,7 @@ void BitmapOutputDev::setDefaultCTM(double *ctm) rgbdev->setDefaultCTM(ctm); clip0dev->setDefaultCTM(ctm); clip1dev->setDefaultCTM(ctm); - //gfxdev->setDefaultCTM(ctm);//? + gfxdev->setDefaultCTM(ctm); } void BitmapOutputDev::saveState(GfxState *state) { @@ -1191,16 +1191,24 @@ void BitmapOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, GBool forSoftMask) { msg(" beginTransparencyGroup"); - boolpolydev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask); - rgbdev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask); + GfxState*state1 = state->copy(gTrue); + GfxState*state2 = state->copy(gTrue); + boolpolydev->beginTransparencyGroup(state1, bbox, blendingColorSpace, isolated, knockout, forSoftMask); + rgbdev->beginTransparencyGroup(state2, bbox, blendingColorSpace, isolated, knockout, forSoftMask); clip1dev->beginTransparencyGroup(state, bbox, blendingColorSpace, isolated, knockout, forSoftMask); + delete state1; + delete state2; } void BitmapOutputDev::endTransparencyGroup(GfxState *state) { msg(" endTransparencyGroup"); - boolpolydev->endTransparencyGroup(state); + GfxState*state1 = state->copy(gTrue); + GfxState*state2 = state->copy(gTrue); + boolpolydev->endTransparencyGroup(state1); checkNewBitmap(); - rgbdev->endTransparencyGroup(state); + rgbdev->endTransparencyGroup(state2); + delete state1; + delete state2; clip1dev->endTransparencyGroup(state); } void BitmapOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) @@ -1209,6 +1217,7 @@ void BitmapOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) boolpolydev->paintTransparencyGroup(state,bbox); checkNewBitmap(); rgbdev->paintTransparencyGroup(state,bbox); + clip1dev->paintTransparencyGroup(state,bbox); } void BitmapOutputDev::setSoftMask(GfxState *state, double *bbox, GBool alpha, Function *transferFunc, GfxColor *backdropColor) { -- 1.7.10.4