diff options
author | Armin Le Grand <alg@apache.org> | 2014-06-19 16:49:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-15 16:15:17 +0100 |
commit | 0ca0202a0994c0b7c99c366fd5cafd8a655df203 (patch) | |
tree | 216ae67a2efefa657415446e7f7852a51bc18f88 /include | |
parent | 146c2e006ef5974ea952ce96eba0109c182db237 (diff) |
Resolves: #i125111# limit mem footprint for GraphicObjects...
in 32Bit environments
Conflicts:
svtools/inc/svtools/grfmgr.hxx
svtools/source/graphic/grfmgr.cxx
svtools/source/graphic/grfmgr2.cxx
sw/source/core/doc/notxtfrm.cxx
sw/source/core/graphic/ndgrf.cxx
"commit 62b0eaf37c08dd27244e77b8bc90c691b000ebd6
Related: fdo#50697 reset the cache timeout on GetGraphic
so the graphic gets swapped out Xms after the last use and not Xms after
initial creation regardless of if it got used a moment earlier."
corrected place for stl sort function for linux
(cherry picked from commit a48414a396f7de4e00510e82e3744c097ce3d5d6)
Conflicts:
svtools/source/graphic/grfmgr2.cxx
Change-Id: I79158b7d42629f8dec2bc5565540701bcd3ef6f4
6f21c7fd4d2681446fc1a6d9607366a1e69165a1
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/grfmgr.hxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx index 251ee6d43457..4ef7e10f3b32 100644 --- a/include/svtools/grfmgr.hxx +++ b/include/svtools/grfmgr.hxx @@ -175,6 +175,10 @@ private: Timer* mpSwapOutTimer; GrfSimpleCacheObj* mpSimpleCache; sal_uLong mnAnimationLoopCount; + + // a unique increasing ID to be able to say which data change is older + sal_uLong mnDataChangeTimeStamp; + bool mbAutoSwapped : 1; bool mbTransparent : 1; bool mbAnimated : 1; @@ -299,8 +303,12 @@ private: DECL_LINK( ImplAutoSwapOutHdl, void* ); - void SVT_DLLPRIVATE ResetCacheTimeOut(); + // restart SwapOut timer; this is like touching in a cache to reset to the full timeout value + void SVT_DLLPRIVATE restartSwapOutTimer() const; + // Handle evtl. needed AfterDataChanges, needs to be called when new + // graphic data is swapped in/added to the GraphicManager + void SVT_DLLPRIVATE ImplAfterDataChange(); protected: virtual void GraphicManagerDestroyed(); @@ -506,6 +514,9 @@ public: double fTopCrop, double fRightCrop, double fBottomCrop) const; + + // read access + sal_uLong GetDataChangeTimeStamp() const { return mnDataChangeTimeStamp; } }; typedef ::std::vector< GraphicObject* > GraphicObjectList_impl; @@ -597,12 +608,21 @@ private: OString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; + // This method allows to check memory footprint for all currently swapped in GraphicObjects on this GraphicManager + // which are based on Bitmaps. This is needed on 32Bit systems and only does something on those systems. The problem + // to solve is that normally the SwapOut is timer-driven, but even with short timer settings there are situations + // where this does not trigger - or in other words: A maximum limitation for GraphicManagers was not in place before. + // For 32Bit systems this leads to situations where graphics will be missing. This method will actively swap out + // the longest swapped in graphics until a maximum memory boundary (derived from user settings in tools/options/memory) + // is no longer exceeded + void SVT_DLLPRIVATE ImplCheckSizeOfSwappedInGraphics(); public: GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL ); ~GraphicManager(); void SetMaxCacheSize( sal_uLong nNewCacheSize ); + sal_uLong GetMaxCacheSize() const; void SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, |