summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-02-03 14:54:12 +0200
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-06 20:32:16 +0100
commit2eb8316f5a87629a50484b7f89ce4183370dd357 (patch)
tree2fa8dfc4314caf4f75c1c8f13e2644ae3702e128 /include
parentb77d256b96c5cfb34fa953b3ffc64c664b2a7743 (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> (cherry picked from commit 1ae7a81e542c9b072e519d0ea0d4773ed26ca251) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162908 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'include')
-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