From 5f0cf799b3074c969b8a44c93fd6211a62d238da Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 20 Jul 2026 12:24:43 +0200 Subject: [PATCH] Related tdf#149890: SVG: pattern is displayed with black fill Regression from 5707b5dce7547420a154209d06b444f1cb863d60 tdf#101083 speed up SVG rendering with pattern fill (2) This is the same thing I did in commit 3cbe3a0259bea4dec70e72191ec3c03441926a07 Author: Noel Grandin Date: Mon Jun 14 15:05:59 2021 +0200 tdf#101083 speed up SVG rendering with pattern fill but cut and paste from the VclPixelProcessor2D to the CairoPixelProcessor2D code. Which makes this SVG render in reasonable time when using the cairo backend. We can probably do even better by cutting out the usage of VCL here, but this is good enough for now. + apply the same as af2175bb87b8e8a7184916e110e2b22ec542357d crashtesting: divide by zero since: commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9 Date: Fri Jun 21 12:28:30 2024 +0200 tdf#161086 bitmap location wrong with SVG with an embedded PNG bodge it by using the requested width/height and not the possibly zero on fail actual sizes Change-Id: Ie0e0462e564a568f99d1c5b9c62f71049f71f9b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208275 Reviewed-by: Julien Nabet Tested-by: Jenkins --- drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 80b17d702b1a..208e5882c3e2 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -3575,7 +3575,12 @@ void CairoPixelProcessor2D::processPatternFillPrimitive2D( { mpTargetOutputDevice->Push(vcl::PushFlags::CLIPREGION); mpTargetOutputDevice->IntersectClipRegion(vcl::Region(aMask)); - mpTargetOutputDevice->DrawWallpaper(aMaskRect, Wallpaper(aTileImage)); + Wallpaper aWallpaper(aTileImage); + aWallpaper.SetColor(COL_TRANSPARENT); + Point aPaperPt(aMaskRect.getX() % nTileWidth, aMaskRect.getY() % nTileHeight); + tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel()); + aWallpaper.SetRect(aPaperRect); + mpTargetOutputDevice->DrawWallpaper(aMaskRect, aWallpaper); mpTargetOutputDevice->Pop(); return; }