diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-11 14:32:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-11 17:35:32 +0100 |
commit | f242cc6d5be5c6f5446976fd6a7c26ad0cee7683 (patch) | |
tree | ab49d3894dd60dea324fbf79cea76d7a394af934 /chart2/source/inc | |
parent | 4c3384dd6c4a92404d170f9011c569de045dfbf7 (diff) |
use vectors to build up point data, instead of Sequence
which shaves 1% off the load time of a large chart
Change-Id: Ieb8f029f760f41c3bef63bbc4cd221c1473f0f49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128283
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/inc')
-rw-r--r-- | chart2/source/inc/BaseGFXHelper.hxx | 2 | ||||
-rw-r--r-- | chart2/source/inc/CommonConverters.hxx | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/chart2/source/inc/BaseGFXHelper.hxx b/chart2/source/inc/BaseGFXHelper.hxx index a5b66d1278f4..fd24fa2b45b6 100644 --- a/chart2/source/inc/BaseGFXHelper.hxx +++ b/chart2/source/inc/BaseGFXHelper.hxx @@ -38,6 +38,8 @@ namespace chart::BaseGFXHelper OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const css::drawing::PolyPolygonShape3D& rPolyPoly ); +OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B3DRange getBoundVolume( const std::vector<std::vector<css::drawing::Position3D>>& rPolyPoly ); + OOO_DLLPUBLIC_CHARTTOOLS ::basegfx::B2IRectangle makeRectangle( const css::awt::Point& rPosition, const css::awt::Size& rSize ); diff --git a/chart2/source/inc/CommonConverters.hxx b/chart2/source/inc/CommonConverters.hxx index 989e4002d148..bbe5ec92cb7b 100644 --- a/chart2/source/inc/CommonConverters.hxx +++ b/chart2/source/inc/CommonConverters.hxx @@ -85,21 +85,31 @@ OOO_DLLPUBLIC_CHARTTOOLS void AddPointToPoly( css::drawing::PolyPolygonShape3D& rPoly , const css::drawing::Position3D& rPos , sal_Int32 nSequenceIndex=0 ); +OOO_DLLPUBLIC_CHARTTOOLS +void AddPointToPoly( std::vector<std::vector<css::drawing::Position3D>>& rPoly + , const css::drawing::Position3D& rPos + , sal_Int32 nSequenceIndex=0 ); /** get a single Point from a Polygon */ OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D getPointFromPoly( + const std::vector<std::vector<css::drawing::Position3D>>& rPolygon + , sal_Int32 nPointIndex, sal_Int32 nPolyIndex ); +OOO_DLLPUBLIC_CHARTTOOLS css::drawing::Position3D getPointFromPoly( const css::drawing::PolyPolygonShape3D& rPolygon , sal_Int32 nPointIndex, sal_Int32 nPolyIndex ); OOO_DLLPUBLIC_CHARTTOOLS void addPolygon( css::drawing::PolyPolygonShape3D& rRet , const css::drawing::PolyPolygonShape3D& rAdd ); +OOO_DLLPUBLIC_CHARTTOOLS +void addPolygon( std::vector<std::vector<css::drawing::Position3D>>& rRet + , const std::vector<std::vector<css::drawing::Position3D>>& rAdd ); /** PolyPolygonShape3D + PolyPolygonShape3D -> PolyPolygonShape3D */ OOO_DLLPUBLIC_CHARTTOOLS -void appendPoly( css::drawing::PolyPolygonShape3D& rRet - , const css::drawing::PolyPolygonShape3D& rAdd ); +void appendPoly( std::vector<std::vector<css::drawing::Position3D>>& rRet + , const std::vector<std::vector<css::drawing::Position3D>>& rAdd ); /** PolyPolygonBezierCoords -> PolyPolygonShape3D */ @@ -112,12 +122,18 @@ css::drawing::PolyPolygonShape3D BezierToPoly( OOO_DLLPUBLIC_CHARTTOOLS css::drawing::PointSequenceSequence PolyToPointSequence( const css::drawing::PolyPolygonShape3D& rPolyPolygon ); +OOO_DLLPUBLIC_CHARTTOOLS +css::drawing::PointSequenceSequence PolyToPointSequence( + const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon ); /** PolyPolygonShape3D -> basegfx::B2DPolyPolygon (2D) */ OOO_DLLPUBLIC_CHARTTOOLS basegfx::B2DPolyPolygon PolyToB2DPolyPolygon( const css::drawing::PolyPolygonShape3D& rPolyPolygon ); +OOO_DLLPUBLIC_CHARTTOOLS +basegfx::B2DPolyPolygon PolyToB2DPolyPolygon( + const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon ); /** drawing::PointSequenceSequence + drawing::PointSequenceSequence */ |