diff options
author | Armin Le Grand (Allotropia) <Armin.Le.Grand@me.com> | 2023-01-13 10:42:44 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-01-13 20:00:19 +0000 |
commit | 9455aae461685809191a3051cf86a208fa5946b4 (patch) | |
tree | 0700fe7f670945732568c63e522af156499fca2a /drawinglayer/source/primitive2d | |
parent | a25eda715591cfa96136bcfd95360156516239d1 (diff) |
SDPR: Direct support for FillGraphicPrimitive2D
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
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/source/primitive2d')
-rw-r--r-- | drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx index 383d199f52b0..8c50993e6033 100644 --- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx @@ -95,7 +95,8 @@ namespace drawinglayer::primitive2d basegfx::B2DHomMatrix aTransformation, const attribute::FillGraphicAttribute& rFillGraphic) : maTransformation(std::move(aTransformation)), - maFillGraphic(rFillGraphic) + maFillGraphic(rFillGraphic), + maOffsetXYCreatedBitmap() { } |