drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 28 +++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-)
New commits: commit 3ae1e5d44d6710ac9acb132b213fabb4d0b22f92 Author: Armin Le Grand (Collabora) <[email protected]> AuthorDate: Thu Jun 19 17:23:10 2025 +0200 Commit: Aron Budea <[email protected]> CommitDate: Wed Sep 10 06:42:35 2025 +0200 tdf#166709 better to use TransparencePrimitive2D for metafile See comments in code & task. Change-Id: I6c34a86ab713130b427fd5efad83b7028a32bc19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186721 Tested-by: Jenkins Reviewed-by: Armin Le Grand <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186740 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> (cherry picked from commit 3cff0b3ff4f5f16a0bca2694134e7d2e511b7c79) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190729 Reviewed-by: Aron Budea <[email protected]> diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index f4cbff957e53..634948049eaf 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1045,9 +1045,31 @@ void VclMetafileProcessor2D::processFillGraphicPrimitive2D( rAttribute.getOffsetY()))) }, rFillGraphicPrimitive2D.getTransparency())); - // process UnifiedTransparencePrimitive2D primitive directly - processUnifiedTransparencePrimitive2D( - static_cast<const primitive2d::UnifiedTransparencePrimitive2D&>(*aPrimitive)); + // tdf#166709 see comments 21-23, we have two possibilities here: + // (a) use UnifiedTransparencePrimitive2D: test PDF is 47.5kb + // (b) use TransparencePrimitive2D: test PDF is 30.8 kb + // differences are described in the task. Due to (b) being smaller + // and is better re-loadable I opt for that. To be able to change + // this easily I let both versions stand here + static bool bTransparencePrimitive2DUse(true); + + if (bTransparencePrimitive2DUse) + { + // process recursively. Since this first gets the decomposition + // (else a primitive processor would loop recursively) this will + // use TransparencePrimitive2D, created by + // UnifiedTransparencePrimitive2D::get2DDecomposition. This could + // also be done here, but that decompose already has needed stuff + // and we keep it in one place + process(*aPrimitive); + } + else + { + // process UnifiedTransparencePrimitive2D primitive directly + processUnifiedTransparencePrimitive2D( + static_cast<const primitive2d::UnifiedTransparencePrimitive2D&>( + *aPrimitive)); + } // we are done, return return;
