diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-07 18:53:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-23 11:45:33 +0100 |
commit | e3bd776e020723ad8caf0a02d8db0d19e0f0e650 (patch) | |
tree | 8ed999eb97278d2cb7954695f03d0bc3652ee6b0 /sfx2 | |
parent | be596c0192f059324d06716b625be6a11079f8ea (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 'sfx2')
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 51cde7cb8a7a..dc1f26a969b3 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -156,7 +156,7 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid const drawinglayer::primitive2d::Primitive2DReference xTransformRef( new drawinglayer::primitive2d::TransformPrimitive2D( aTransform, - aVectorGraphicData.getPrimitive2DSequence())); + drawinglayer::primitive2d::Primitive2DContainer(aVectorGraphicData.getPrimitive2DSequence()))); // UNO dance to render from drawinglayer @@ -178,7 +178,7 @@ bool SfxApplication::loadBrandSvg(const char *pName, BitmapEx &rBitmap, int nWid const uno::Reference< rendering::XBitmap > xBitmap( xPrimitive2DRenderer->rasterize( - drawinglayer::primitive2d::Primitive2DSequence(&xTransformRef, 1), + drawinglayer::primitive2d::Primitive2DContainer{xTransformRef}.toSequence(), uno::Sequence< beans::PropertyValue >(), fFakeDPI, fFakeDPI, diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 04de9a437550..37043f8767c0 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -18,6 +18,7 @@ #include <comphelper/processfactory.hxx> #include <drawinglayer/attribute/fontattribute.hxx> #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx> +#include <drawinglayer/primitive2d/Primitive2DContainer.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/processorfromoutputdevice.hxx> diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index b4924dc4474c..7050dee85964 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -80,6 +80,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/docpasswordrequest.hxx> #include <comphelper/docpasswordhelper.hxx> +#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <com/sun/star/uno/Reference.h> |