summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-02-04 13:15:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-12 11:36:05 +0100
commit3b83c6ac804cf7adcea036d1fb7dda113a72f457 (patch)
tree8f1af5f06f236a1dcb9ca313f3dedd3aa8c16390 /drawinglayer/source/processor2d
parent582ef812702413dbe7fb0f132bca3e3e4c2e1d40 (diff)
make BufferedDecompositionPrimitive2D store a Primitive2DReference..
.. instead of a Primitive2DContainer. The container very frequently contains only a single item, since the decomposition method often sticks only a single top-level node in there, so it turns out to be a net loss overall, memory consumption-wise. Also, if we return a single Primitive2DReference from a BufferedDecomposition, that maximises the sharing of data between the BufferedDecomposition objects at the bottom of the decomposed tree, and objects higher up. Change-Id: Iaf272e60e2997299cc35a1bd209c51b6b79e9a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source/processor2d')
-rw-r--r--drawinglayer/source/processor2d/baseprocessor2d.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index f4aec90383ee..13d6b4c63b08 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -49,7 +49,8 @@ namespace drawinglayer::processor2d
// Primitive2DDecompositionVisitor
void BaseProcessor2D::visit(const primitive2d::Primitive2DReference& rCandidate)
{
- processBasePrimitive2D(*rCandidate);
+ if (rCandidate)
+ processBasePrimitive2D(*rCandidate);
}
void BaseProcessor2D::visit(const primitive2d::Primitive2DContainer& rContainer)
{