SDPR: Direct support for FillGraphicPrimitive2D

Desktop / LibreOffice - Armin Le Grand (Allotropia) [me.com] - 13 January 2023 20:00 UTC

Added support to directly paint FillGraphicPrimitive2D, that means object fill with multiple tiles/tiled fill. Note: This may use not only bitmap data, but also metafile or svg.

The standard decompose creates one transformed bitmap/vector data primitive per tile what is correct, but has some limits (a) These may get many when tiles are small compared to mask polyPolygon (performance/ressources) (b) Correctness: when rendering in AA the common edges of tiles will *not* sum up perfectly, but due to AA multiplying when blending will leave ugly 'traces'

This direct rendering avoids both. It can use the D2D Brush functionality to repeat. Additionally to the current office it can also do that when content is rotated/sheared. This may not be well known since for those fills the office always keeps the fill unrotated (for historical reasons, primitives can do that, but not vcl). To see it you may convert a SdrObject to metafile and rotate that, so the content gets rotated and shows that ugly gaps.

Also added a square-pixel step value for vector fills where the default gets used starting from some size. The argument is better quality for vector data fills while only a limited number of tiles will be rendered.

Also added a buffered handling of the (old and ugly) OffsetX/OffsetY to make that work, we will not get rid of that soon.

Packed all of this into tooling (so started a tooling collection for SDPRs target-system independent) to be able to easily re-use all these preparations/tests in other SDPR implementations in the future.

Change-Id: Iafacf4181e7c9e2d2b2e3b5cf1f7e4cdd0a43f0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145466

9455aae46168 SDPR: Direct support for FillGraphicPrimitive2D
drawinglayer/Library_drawinglayer.mk | 1 +
.../drawinglayeruno/xprimitive2drenderer.cxx | 10 +-
.../source/primitive2d/fillgraphicprimitive2d.cxx | 3 +-
.../source/processor2d/SDPRProcessor2dTools.cxx | 277 +++++++++++++++++++++
.../source/processor2d/d2dpixelprocessor2d.cxx | 159 ++++++++++--
.../primitive2d/fillgraphicprimitive2d.hxx | 31 ++-
.../processor2d/SDPRProcessor2dTools.hxx | 104 ++++++++
.../processor2d/d2dpixelprocessor2d.hxx | 3 +
8 files changed, 571 insertions(+), 17 deletions(-)

Upstream: cgit.freedesktop.org


  • Share