summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-09-21 16:42:01 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-09-21 20:12:09 +0200
commit80b287ad0322afcbf8f80b0507e212870dcf0f98 (patch)
tree7710bc62dfc82d4b77d2f1de3beb55599c4e3527 /include
parentc8b2849d140677f7b35523096eb2bc715b3dc507 (diff)
Support buffering SystemDependent GraphicData
Started to make the buffering more flexible by adding virtual methods virtual sal_uInt32 getHoldCyclesInSeconds() const; virtual sal_Int64 estimateUsageInBytes() const; to class SystemDependentData. This will allow to add more sensitive buffering/caching. Also fine-tuned Linux-derived classes actively used for buffering to be more sensitive when and where to reuse the buffered data Change-Id: Ifc69c318ade0209aff071d76001869d9f4eeb10d Reviewed-on: https://gerrit.libreoffice.org/60881 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include')
-rw-r--r--include/basegfx/utils/systemdependentdata.hxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/basegfx/utils/systemdependentdata.hxx b/include/basegfx/utils/systemdependentdata.hxx
index 6d4a90d10cda..920a55043870 100644
--- a/include/basegfx/utils/systemdependentdata.hxx
+++ b/include/basegfx/utils/systemdependentdata.hxx
@@ -89,14 +89,9 @@ namespace basegfx
// a single, globally used one, but not necessarily
SystemDependentDataManager& mrSystemDependentDataManager;
- // number of cycles a SystemDependentDataManager should/might
- // hold this instance - does not have to be used, but should be
- sal_uInt32 mnHoldCycles;
-
public:
SystemDependentData(
- SystemDependentDataManager& rSystemDependentDataManager,
- sal_uInt32 nHoldCycles = 60);
+ SystemDependentDataManager& rSystemDependentDataManager);
// CAUTION! It is VERY important to keep this base class
// virtual, else typeid(class).hash_code() from derived classes
@@ -108,8 +103,17 @@ namespace basegfx
// using getSystemDependentDataManager()
SystemDependentDataManager& getSystemDependentDataManager() { return mrSystemDependentDataManager; }
- // number of cycles to hold data
- sal_uInt32 getHoldCycles() const { return mnHoldCycles; }
+ // Number of cycles a SystemDependentDataManager should/might
+ // hold this instance in seconds - does not have to be used,
+ // but should be. Default implementation returns 60(s). Override to
+ // offer useful data if you want to have better caching.
+ virtual sal_uInt32 getHoldCyclesInSeconds() const;
+
+ // Size estimation of the entry in bytes - does not have to
+ // be used, but should be. Default returns zero what
+ // means there is no size estimation available. Override to
+ // offer useful data if you want to have better caching.
+ virtual sal_Int64 estimateUsageInBytes() const;
};
} // end of namespace basegfx