summaryrefslogtreecommitdiff
path: root/include/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-02-03 14:54:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-05 12:10:58 +0100
commit1ae7a81e542c9b072e519d0ea0d4773ed26ca251 (patch)
tree161a33259d409891faa9bf663098e35662fb4487 /include/drawinglayer
parent4259b451c26eec782eb15c7603f6fbb06fc3787e (diff)
tdf#108037 Reduce time and memory consumed exporting to PDF
by avoiding making multiple copies of the Primitive2D container that we pass to TransformPrimitive2D. Instead, make TransformPrimitive2D store its children using a GroupPrimitive2D, which means we can share the GroupPrimitive2D among all the TransformPrimitive2D instances we create. Change-Id: I8a4398f9db6a6ab013ee24ad53836975fba6f3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/drawinglayer')
-rw-r--r--include/drawinglayer/primitive2d/transformprimitive2d.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/drawinglayer/primitive2d/transformprimitive2d.hxx b/include/drawinglayer/primitive2d/transformprimitive2d.hxx
index 73e589b8c2e8..8c3c22cc5b90 100644
--- a/include/drawinglayer/primitive2d/transformprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/transformprimitive2d.hxx
@@ -46,19 +46,24 @@ namespace drawinglayer::primitive2d
different, transformed states without the need to create those
thousand primitive contents.
*/
- class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D final : public GroupPrimitive2D
+ class DRAWINGLAYER_DLLPUBLIC TransformPrimitive2D final : public BasePrimitive2D
{
private:
// the transformation to apply to the child geometry
basegfx::B2DHomMatrix maTransformation;
+ rtl::Reference<GroupPrimitive2D> mxChildren;
public:
/// constructor
TransformPrimitive2D(
basegfx::B2DHomMatrix aTransformation,
Primitive2DContainer&& rChildren);
+ TransformPrimitive2D(
+ basegfx::B2DHomMatrix aTransformation,
+ GroupPrimitive2D& rChildren);
/// data read access
+ const Primitive2DContainer& getChildren() const { return mxChildren->getChildren(); }
const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; }
/// compare operator