drawinglayer/source/processor2d/cairopixelprocessor2d.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 4f65d3e2446a246a95fb963e1bafff7bfa0966d3
Author:     Armin Le Grand (Collabora) <armin.le.gr...@me.com>
AuthorDate: Fri May 23 19:07:18 2025 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon May 26 14:48:23 2025 +0200

    CairoSDPR: Correct BackgroundColorPrimitive2D when Viewport set
    
    If the BackgroundColorPrimitive2D has a Viewport set this means
    we have limitations, so render as needed/defined. This can be
    done additionally by creating geometry for that range, or just
    use the decomposition. To do so, just use recursion/decompose
    in this case.
    
    Change-Id: I85fe6eb78fe8d154ced99d53af40ba0d9f1049d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185718
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>
    Tested-by: Jenkins
    (cherry picked from commit 0957ec405757ad72d2e1fe4ceed4ac486b27aa21)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185798
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
index 4264d188e38b..595f6da9a4d4 100644
--- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
@@ -2034,6 +2034,16 @@ void 
CairoPixelProcessor2D::processBackgroundColorPrimitive2D(
         || rBackgroundColorCandidate.getTransparency() >= 1.0)
         return;
 
+    if (!getViewInformation2D().getViewport().isEmpty())
+    {
+        // we have a Viewport set with limitations, render as needed/defined
+        // by BackgroundColorPrimitive2D::create2DDecomposition. Alternatively,
+        // just use recursion/decompose in this case
+        process(rBackgroundColorCandidate);
+        return;
+    }
+
+    // no Viewport set, render surface completely
     cairo_save(mpRT);
     const basegfx::BColor aFillColor(
         
maBColorModifierStack.getModifiedColor(rBackgroundColorCandidate.getBColor()));

Reply via email to