diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-10-09 13:21:34 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-10-12 15:13:17 +0200 |
commit | 59cca1a28df4cdc94450d68cc1e247a8fb5ff6f3 (patch) | |
tree | 84d6aebfb103a2fe33b6601d66c6fd4e5fbb6510 /include/sfx2/objsh.hxx | |
parent | 1e78b576cdbe4d938ef8eeabd9083f62f92416be (diff) |
render document thumbnail directly to bitmap, without metafile
I don't see the point of taking the detour via GDIMetaFile and
then immediately drawing using it to a bitmap. Simply draw directly
to a bitmap. Especially given that when drawing to a metafile
some fast cases are skipped, e.g. DrawTransformedBitmapEx()
avoids DrawTransformBitmapExDirect() and resorts to using the slow
BitmapEx::getTransformed(). E.g. with tdf#136223. this makes
SfxPickListImpl::AddDocumentToPickList() go from 30% to 13%
of the total document loading time.
Change-Id: Ib1643eddfc2b75a3d7be60138fb5226352805826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104114
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/sfx2/objsh.hxx')
-rw-r--r-- | include/sfx2/objsh.hxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 78a1f3eb22e6..e106d7f3a367 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -26,6 +26,7 @@ #include <vcl/errcode.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Sequence.hxx> +#include <vcl/bitmapex.hxx> #include <svl/poolitem.hxx> #include <sot/formats.hxx> @@ -64,6 +65,7 @@ class Color; class Fraction; class SvGlobalName; class InfobarData; +class VirtualDevice; enum class SfxModelFlags; enum class SfxEventHintId; @@ -445,6 +447,10 @@ public: Size GetFirstPageSize() const; bool DoClose(); std::shared_ptr<GDIMetaFile> GetPreviewMetaFile( bool bFullContent = false ) const; + BitmapEx GetPreviewBitmap( + bool bFullContent = false, + BmpConversion nColorConversion = BmpConversion::N24Bit, + BmpScaleFlag nScaleFlag = BmpScaleFlag::BestQuality) const; virtual void CancelTransfers(); bool GenerateAndStoreThumbnail( @@ -681,7 +687,7 @@ public: bool bShowCloseButton = true); std::vector<InfobarData>& getPendingInfobars(); - SAL_DLLPRIVATE std::shared_ptr<GDIMetaFile> CreatePreviewMetaFile_Impl(bool bFullContent) const; + SAL_DLLPRIVATE bool CreatePreview_Impl(bool bFullContent, VirtualDevice* pDevice, GDIMetaFile* pFile) const; SAL_DLLPRIVATE static bool IsPackageStorageFormat_Impl(const SfxMedium &); |