diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-11 14:06:53 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2020-03-11 16:24:36 +0100 |
commit | c3f0c527b31f5c88263ea63d3d0e332c4783917c (patch) | |
tree | bab3bd06413795688746dc95f9e92eca77203fc6 /include/drawinglayer/primitive2d | |
parent | 367431b6987b75e7a201499bfbd25a41c92a4a59 (diff) |
tdf#124424 Enhanced SvgGradientHelper for EMF+
Added support for repeat modes in GDI+ support
and saw that the SVG primitive gradient helpers
are not capable to support these completely, so
had to do some quite complex adaptions which
OTOH will be useful for more complex gradients
anyways
Change-Id: Ib9a9e4a55115834a4fb00300b05abe17ae36d105
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90329
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'include/drawinglayer/primitive2d')
-rw-r--r-- | include/drawinglayer/primitive2d/svggradientprimitive2d.hxx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx b/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx index c130368bf5b9..871a4aea822d 100644 --- a/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/svggradientprimitive2d.hxx @@ -101,6 +101,9 @@ namespace drawinglayer /// the gradient definition SvgGradientEntryVector maGradientEntries; + // internal helper for case SpreadMethod::Reflect + SvgGradientEntryVector maMirroredGradientEntries; + /// start and/or center point basegfx::B2DPoint maStart; @@ -117,6 +120,12 @@ namespace drawinglayer // (related to SVG's gradientUnits (userSpaceOnUse|objectBoundingBox) bool mbUseUnitCoordinates : 1; + /// local helpers + const SvgGradientEntryVector& getMirroredGradientEntries() const; + void createMirroredGradientEntries(); + const SvgGradientEntry& FindEntryLessOrEqual(sal_Int32& rInt, const double fFrac) const; + const SvgGradientEntry& FindEntryMore(sal_Int32& rInt,const double fFrac) const; + protected: /// local helpers void createSingleGradientEntryFill(Primitive2DContainer& rContainer) const; @@ -125,14 +134,13 @@ namespace drawinglayer Primitive2DContainer& rTargetOpacity, const SvgGradientEntry& rFrom, const SvgGradientEntry& rTo, - sal_Int32 nOffset) const = 0; - double createRun( + sal_Int32 nOffsetFrom, + sal_Int32 nOffsetTo) const = 0; + void createRun( Primitive2DContainer& rTargetColor, Primitive2DContainer& rTargetOpacity, - double fPos, - double fMax, - const SvgGradientEntryVector& rEntries, - sal_Int32 nOffset) const; + double fStart, + double fEnd) const; virtual void checkPreconditions(); void createResult( Primitive2DContainer& rContainer, @@ -191,7 +199,8 @@ namespace drawinglayer Primitive2DContainer& rTargetOpacity, const SvgGradientEntry& rFrom, const SvgGradientEntry& rTo, - sal_Int32 nOffset) const override; + sal_Int32 nOffsetFrom, + sal_Int32 nOffsetTo) const override; virtual void checkPreconditions() override; /// local decomposition. @@ -243,22 +252,16 @@ namespace drawinglayer basegfx::B2DVector maFocalVector; double maFocalLength; - // internal helper for case SpreadMethod::Reflect - SvgGradientEntryVector maMirroredGradientEntries; - bool mbFocalSet : 1; /// local helpers - const SvgGradientEntryVector& getMirroredGradientEntries() const; - void createMirroredGradientEntries(); - - /// local helpers virtual void createAtom( Primitive2DContainer& rTargetColor, Primitive2DContainer& rTargetOpacity, const SvgGradientEntry& rFrom, const SvgGradientEntry& rTo, - sal_Int32 nOffset) const override; + sal_Int32 nOffsetFrom, + sal_Int32 nOffsetTo) const override; virtual void checkPreconditions() override; /// local decomposition. |