From 4b5203ebf4ca5894f4d7dd37a141832df26e8b9a Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (allotropia)" Date: Tue, 4 Apr 2023 14:57:06 +0200 Subject: MCGR: Improve performance for texture-mapped MCGR processing Change-Id: I20b32e7c272112c6c3d9f7ee0ef59c6d4d006d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150020 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- include/basegfx/utils/gradienttools.hxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/basegfx') diff --git a/include/basegfx/utils/gradienttools.hxx b/include/basegfx/utils/gradienttools.hxx index ea1802c291f8..f438fdf3bd4a 100644 --- a/include/basegfx/utils/gradienttools.hxx +++ b/include/basegfx/utils/gradienttools.hxx @@ -194,6 +194,23 @@ namespace basegfx } }; + // helper data struct to support buffering entries in + // gradient texture mapping, see usages for more info + struct UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) ColorStopRange + { + basegfx::BColor maColorStart; + basegfx::BColor maColorEnd; + double mfOffsetStart; + double mfOffsetEnd; + + ColorStopRange() + : maColorStart() + , maColorEnd() + , mfOffsetStart(0.0) + , mfOffsetEnd(0.0) + {} + }; + namespace utils { /* Tooling method to linearly blend the Colors contained in @@ -293,7 +310,8 @@ namespace basegfx BASEGFX_DLLPUBLIC BColor modifyBColor( const ColorStops& rColorStops, double fScaler, - sal_uInt32 nRequestedSteps); + sal_uInt32 nRequestedSteps, + ColorStopRange& rLastColorStopRange); /* Helper to calculate numberOfSteps needed to represent gradient for the given two colors: -- cgit