summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-07 18:53:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-23 11:45:33 +0100
commite3bd776e020723ad8caf0a02d8db0d19e0f0e650 (patch)
tree8ed999eb97278d2cb7954695f03d0bc3652ee6b0 /filter
parentbe596c0192f059324d06716b625be6a11079f8ea (diff)
Split BasePrimitive2D UNO interface into separate object
Rather than make all the BasePrimitive2D classes bear the cost of being an UNO object, we just wrap the top level BasePrimitive2D in this class when we need to pass them over UNO. This reduces the locking overhead when doing normal drawinglayer operations, and reduces the size of drawinglayer objects and the cost of initialising them, which shaves 5% off the load/display time of a large barchart. Add new drawinglayer::convertPrimitive2DContainerToBitmapEx utility method to avoid needing to convert to Sequence<XPrimitive2D> Change-Id: I553eaa4c16ba016b098cb21f6c55f5008f0d9b53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126487 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/Library_pdffilter.mk1
-rw-r--r--filter/source/pdf/pdfdecomposer.cxx8
-rw-r--r--filter/source/svg/svgfilter.cxx12
3 files changed, 11 insertions, 10 deletions
diff --git a/filter/Library_pdffilter.mk b/filter/Library_pdffilter.mk
index 6219c3a306aa..178a479d72ac 100644
--- a/filter/Library_pdffilter.mk
+++ b/filter/Library_pdffilter.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Library_use_libraries,pdffilter,\
cppuhelper \
cppu \
sal \
+ salhelper \
drawinglayer \
drawinglayercore \
))
diff --git a/filter/source/pdf/pdfdecomposer.cxx b/filter/source/pdf/pdfdecomposer.cxx
index 1118021a6377..f861b4eaf86e 100644
--- a/filter/source/pdf/pdfdecomposer.cxx
+++ b/filter/source/pdf/pdfdecomposer.cxx
@@ -13,6 +13,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/pdfread.hxx>
#include <vcl/svapp.hxx>
@@ -89,8 +90,11 @@ XPdfDecomposer::getDecomposition(const uno::Reference<util::XBinaryDataContainer
0));
// create primitive
- return { new drawinglayer::primitive2d::BitmapPrimitive2D(
- VCLUnoHelper::CreateVCLXBitmap(aReplacement), aBitmapTransform) };
+ return drawinglayer::primitive2d::Primitive2DContainer{
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
+ VCLUnoHelper::CreateVCLXBitmap(aReplacement), aBitmapTransform)
+ }
+ .toSequence();
}
OUString SAL_CALL XPdfDecomposer::getImplementationName()
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 174c3bbb35b0..4c3f033d02eb 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -45,6 +45,7 @@
#include <tools/zcodec.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include "svgfilter.hxx"
@@ -258,15 +259,10 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto
for(const auto& rCandidate : aContainer)
{
- if(rCandidate.is())
+ if(rCandidate && PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D != rCandidate->getPrimitive2DID())
{
- auto pBasePrimitive = static_cast< const drawinglayer::primitive2d::BasePrimitive2D* >(rCandidate.get());
-
- if(PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D != pBasePrimitive->getPrimitive2DID())
- {
- bAllAreHiddenGeometry = false;
- break;
- }
+ bAllAreHiddenGeometry = false;
+ break;
}
}