summaryrefslogtreecommitdiff
path: root/include/drawinglayer/converters.hxx
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 /include/drawinglayer/converters.hxx
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 'include/drawinglayer/converters.hxx')
-rw-r--r--include/drawinglayer/converters.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drawinglayer/converters.hxx b/include/drawinglayer/converters.hxx
index a0b8c4c4be78..1fda7a2f8350 100644
--- a/include/drawinglayer/converters.hxx
+++ b/include/drawinglayer/converters.hxx
@@ -29,6 +29,14 @@ convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&& rSeq,
const geometry::ViewInformation2D& rViewInformation2D, sal_uInt32 nDiscreteWidth,
sal_uInt32 nDiscreteHeight, sal_uInt32 nMaxSquarePixels);
+// helper to convert any Primitive2DSequence to a good quality BitmapEx,
+// using default parameters
+BitmapEx DRAWINGLAYER_DLLPUBLIC convertPrimitive2DContainerToBitmapEx(
+ drawinglayer::primitive2d::Primitive2DContainer&& rSeq, const basegfx::B2DRange& rTargetRange,
+ const sal_uInt32 nMaximumQuadraticPixels = 500000,
+ const o3tl::Length eTargetUnit = o3tl::Length::mm100,
+ const std::optional<Size>& rTargetDPI = std::nullopt);
+
} // end of namespace drawinglayer
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */