Created attachment 180991 [details] Writer example with a gradient filled Frame & a anchored SubFrame that is not correctly filled A Gradient has a DefinitionRange and a OutputRange, e.g when the whole page has a gradient that's it's DefinitionRange, objects placed on it may only use a part of it when being placed inside it, where then the OutputRange would be inside the DefinitionRange. But there are also cases where the OutputRange is not completely inside the DefinitionRange. One such case are Frames in Writer with Frames anchored in Frames & parent Frame filled with Gradient, you may move child frame outside parent -> Parts outside parent/DefinitionRange stay empty/not painted. This is an error and worked once. I add an example that shows the error as that example. Since the new FillMode SlideBackgroundFill also uses that I stumbled over it & have to correct it.
Taking a look
Problem is in VclPixelProcessor2D::processFillGradientPrimitive2D: VCL gradient draw is not capable to handle all primitive gradient definitions, what should be clear due to being developed to ectend/replace them in capabilities & precision. It is e.g. not capable to correctly paint if the OutputRange is not completely inside the DefinitionRange, thus forcing to paint gradent parts *outside* the DefinitionRange. This happens for Writer with Frames anchored in Frames (and was broken due to falling back to VCL Gradient paint here), and for the new SlideBackgroundFill Fill mode for objects using it that reach outside the page (which is the DefinitionRange in that case). I see no real reason to fallback here to OutputDevice::DrawGradient and VCL gradient paint at all (system-dependent renderers wouldn't in the future), but will for convenience only add that needed additional correcting case...
Note: Also needed to correct/complete tdf#128150
doe with https://gerrit.libreoffice.org/c/core/+/136561
Armin Le Grand (allotropia) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0be0b4e57cbeaab3e73f1d12ef2ad9b55fd1c885 tdf#149754 correct gradient paint for outside definition range It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.