From 846575911483787a0fe28d76c4e9b51a644d7152 Mon Sep 17 00:00:00 2001 From: Oliver Sander Date: Tue, 21 Apr 2020 16:03:37 +0200 Subject: [splash, arthur] Use stroking opacity when clipping to a stroke path When filling a region that is clipped to a stroke path, then the stroking opacity shall be used rather than the fill opacity. I couldn't find this in the spec, but it seems to be what Acrobat does. BUG: https://gitlab.freedesktop.org/poppler/poppler/-/issues/178 --- poppler/SplashOutputDev.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'poppler/SplashOutputDev.cc') diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 346e836d..2bcabc99 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -42,6 +42,7 @@ // Copyright (C) 2018, 2019 Stefan BrĂ¼ns // Copyright (C) 2018 Adam Reichold // Copyright (C) 2019 Christian Persch +// Copyright (C) 2020 Oliver Sander // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -4609,7 +4610,9 @@ bool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePatt pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), nullptr); - retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern) == splashOk); + // If state->getStrokePattern() is set, then the current clipping region + // is a stroke path. + retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern, (state->getStrokePattern()!=nullptr)) == splashOk); state->clearPath(); setVectorAntialias(vaa); @@ -4670,7 +4673,9 @@ bool SplashOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *sh pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS); setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(), state->getOverprintMode(), nullptr); - retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern) == splashOk); + // If state->getStrokePattern() is set, then the current clipping region + // is a stroke path. + retVal = (splash->shadedFill(&path, pattern->getShading()->getHasBBox(), pattern, (state->getStrokePattern()!=nullptr)) == splashOk); state->clearPath(); setVectorAntialias(vaa); -- cgit v1.2.3