diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-10-09 13:21:34 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-10-13 22:52:26 +0200 |
commit | f43a202ec1d9ed37cc894c31ff3f2ad4c5a1d2ad (patch) | |
tree | 91c859b14121fd453b119e0eb13e6df23f8dd8d9 /include | |
parent | 68a4433598057e69c30263da94b3d3ca20a1481e (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.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104114
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit 59cca1a28df4cdc94450d68cc1e247a8fb5ff6f3)
Change-Id: Ib1643eddfc2b75a3d7be60138fb5226352805826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104156
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-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 4c0ea7f22f09..2d6a4c3cd2d3 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> @@ -63,6 +64,7 @@ class Color; class Fraction; class SvGlobalName; class InfobarData; +class VirtualDevice; enum class SfxModelFlags; enum class SfxEventHintId; @@ -434,6 +436,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( @@ -662,7 +668,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 &); |