diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-04-14 15:13:05 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-04-20 09:15:22 +0200 |
commit | 7b355669c6ddeab2e6cec692d6afdff41c61d0fb (patch) | |
tree | 46c55326bccfa68a2bb5fad6d637e0f4576c8d68 /include | |
parent | 663fd3d6e1f93ec989dc289e688d5dbfe434cbca (diff) |
Function to load graphic swapped out (loaded on demand)
When a document is loaded it takes a lot of time and memory to
load the graphic that are in the documet, so avoid that and just
store the compressed graphic into a temporary file (handeled by
GfxLink) and load when we really need to show the graphic.
GraphicObject cached some attributes from Graphic, but this
attributes now aren't available immediately so this attributes
are removed form GraphicObject and now delegate to the Graphic
itself. GetSizeBytes attribute however was removed as it is
only used in some tests.
GfxLink initial values were moved to the constructor and are
not set in the header file anymore (as it is the recommended
way to do it).
The SdImportTest::testDocumentLayout failed as it looks like the
dump sometimes didn't include the width and height of the null
bitmap (which is set to 32x32) of the FillBitmap in some
situations, but then in other situations it did include this
attributes. With this change the width and height are always
included for the FillBitmap which looks like it is more correct.
Change-Id: Ia1218f93b1735402b7828404f65660e2d4acf32f
Reviewed-on: https://gerrit.libreoffice.org/53016
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdograf.hxx | 4 | ||||
-rw-r--r-- | include/vcl/GraphicObject.hxx | 23 | ||||
-rw-r--r-- | include/vcl/gfxlink.hxx | 10 | ||||
-rw-r--r-- | include/vcl/graph.hxx | 3 | ||||
-rw-r--r-- | include/vcl/graphicfilter.hxx | 3 | ||||
-rw-r--r-- | include/vcl/salctype.hxx | 3 |
6 files changed, 21 insertions, 25 deletions
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index f3b0b1946564..9b1a4631b376 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -156,8 +156,8 @@ public: bool IsEPS() const; bool IsSwappedOut() const; - const MapMode& GetGrafPrefMapMode() const; - const Size& GetGrafPrefSize() const; + MapMode GetGrafPrefMapMode() const; + Size GetGrafPrefSize() const; void SetGrafStreamURL( const OUString& rGraphicStreamURL ); OUString const & GetGrafStreamURL() const; diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx index 140ea7402540..d9f60e49598d 100644 --- a/include/vcl/GraphicObject.hxx +++ b/include/vcl/GraphicObject.hxx @@ -172,19 +172,9 @@ class VCL_DLLPUBLIC GraphicObject private: Graphic maGraphic; GraphicAttr maAttr; - Size maPrefSize; - MapMode maPrefMapMode; - sal_uLong mnSizeBytes; - GraphicType meType; OUString maUserData; std::unique_ptr<GrfSimpleCacheObj> mxSimpleCache; - sal_uInt32 mnAnimationLoopCount; - bool mbTransparent : 1; - bool mbAnimated : 1; - bool mbEPS : 1; - - void VCL_DLLPRIVATE ImplAssignGraphicData(); bool VCL_DLLPRIVATE ImplGetCropParams( OutputDevice const * pOut, Point& rPt, @@ -342,13 +332,12 @@ public: OString GetUniqueID() const; - GraphicType GetType() const { return meType; } - const Size& GetPrefSize() const { return maPrefSize; } - const MapMode& GetPrefMapMode() const { return maPrefMapMode; } - sal_uLong GetSizeBytes() const { return mnSizeBytes; } - bool IsTransparent() const { return mbTransparent; } - bool IsAnimated() const { return mbAnimated; } - bool IsEPS() const { return mbEPS; } + GraphicType GetType() const; + Size GetPrefSize() const; + MapMode GetPrefMapMode() const; + bool IsTransparent() const; + bool IsAnimated() const; + bool IsEPS() const; bool Draw( OutputDevice* pOut, diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 2d84fd293e4f..054ab2cf2dca 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -64,17 +64,17 @@ private: }; - GfxLinkType meType = GfxLinkType::NONE; - sal_uInt32 mnUserId = 0; + GfxLinkType meType; + sal_uInt32 mnUserId; std::shared_ptr<sal_uInt8> mpSwapInData; std::shared_ptr<SwapOutData> mpSwapOutData; - sal_uInt32 mnSwapInDataSize = 0; + sal_uInt32 mnSwapInDataSize; MapMode maPrefMapMode; Size maPrefSize; - bool mbPrefMapModeValid = false; - bool mbPrefSizeValid = false; + bool mbPrefMapModeValid; + bool mbPrefSizeValid; SAL_DLLPRIVATE std::shared_ptr<sal_uInt8> GetSwapInData() const; public: diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index d69b9e8538b0..8406686c6e09 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -144,6 +144,9 @@ public: bool IsAnimated() const; bool IsEPS() const; + bool isAvailable() const; + bool makeAvailable(); + // #i102089# Access of Bitmap potentially will have to rasterconvert the Graphic // if it is a MetaFile. To be able to control this conversion it is necessary to // allow giving parameters which control AntiAliasing and LineSnapping of the diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index bc218851f412..adf308914837 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -98,6 +98,7 @@ namespace o3tl #define WMF_SHORTNAME "WMF" #define EMF_SHORTNAME "EMF" #define SVG_SHORTNAME "SVG" +#define PDF_SHORTNAME "PDF" // Info class for all supported file formats @@ -289,6 +290,8 @@ public: css::uno::Sequence< css::beans::PropertyValue >* pFilterData, WmfExternal const *pExtHeader = nullptr ); + Graphic ImportUnloadedGraphic(SvStream& rIStream); + const FilterErrorEx& GetLastError() const { return *pErrorEx;} void ResetLastError(); diff --git a/include/vcl/salctype.hxx b/include/vcl/salctype.hxx index 409fc5a79993..893adb4d47e4 100644 --- a/include/vcl/salctype.hxx +++ b/include/vcl/salctype.hxx @@ -37,7 +37,8 @@ enum class ConvertDataFormat TIF, WMF, EMF, - SVG + SVG, + PDF }; class SvStream; |