summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2020-01-22 17:20:13 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2020-01-23 17:48:55 +0100
commit2da7a82f6b7a78e1e4b34b0b3c7a27d2b3c47a35 (patch)
treedd09d82b6c691c79b50289f9091be02fec276d7d /include
parentd03c46eba1bd1d3399ee3d4e6af1c9e16c2c1718 (diff)
tdf#129845: Better solution using already existing info
Use calculateCombinedHoldCyclesInSeconds() in central places of system-dependent buffering and the zero value to early exclude data from buffering. This solves the problem on all system-dependent usages in a central place. Also enhanced to roughly allow buffering for bitmaps unchanged, for polygons starting with ca. 50 coordinate pairs. Added special treatments to Cairo version to allow temp buffer objects without copying the path data. This needed some extra stuff due to Cairo not allowing to work with it's cr-internal path object directly. Change-Id: Icd0a0d8091707fe356a82f5c7ec48f36ad44ccde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87199 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r--include/basegfx/polygon/b2dpolygon.hxx10
-rw-r--r--include/basegfx/polygon/b2dpolypolygon.hxx10
2 files changed, 16 insertions, 4 deletions
diff --git a/include/basegfx/polygon/b2dpolygon.hxx b/include/basegfx/polygon/b2dpolygon.hxx
index cbef3159705b..72be3525fc0f 100644
--- a/include/basegfx/polygon/b2dpolygon.hxx
+++ b/include/basegfx/polygon/b2dpolygon.hxx
@@ -239,8 +239,14 @@ namespace basegfx
std::shared_ptr<T> addOrReplaceSystemDependentData(SystemDependentDataManager& manager, Args&&... args) const
{
std::shared_ptr<T> r = std::make_shared<T>(manager, std::forward<Args>(args)...);
- basegfx::SystemDependentData_SharedPtr r2(r);
- addOrReplaceSystemDependentDataInternal(r2);
+
+ // tdf#129845 only add to buffer if a relevant buffer time is estimated
+ if(r->calculateCombinedHoldCyclesInSeconds() > 0)
+ {
+ basegfx::SystemDependentData_SharedPtr r2(r);
+ addOrReplaceSystemDependentDataInternal(r2);
+ }
+
return r;
}
diff --git a/include/basegfx/polygon/b2dpolypolygon.hxx b/include/basegfx/polygon/b2dpolypolygon.hxx
index 65e3b97cfc96..d1af340048fd 100644
--- a/include/basegfx/polygon/b2dpolypolygon.hxx
+++ b/include/basegfx/polygon/b2dpolypolygon.hxx
@@ -138,8 +138,14 @@ namespace basegfx
std::shared_ptr<T> addOrReplaceSystemDependentData(SystemDependentDataManager& manager, Args&&... args) const
{
std::shared_ptr<T> r = std::make_shared<T>(manager, std::forward<Args>(args)...);
- basegfx::SystemDependentData_SharedPtr r2(r);
- addOrReplaceSystemDependentDataInternal(r2);
+
+ // tdf#129845 only add to buffer if a relevant buffer time is estimated
+ if(r->calculateCombinedHoldCyclesInSeconds() > 0)
+ {
+ basegfx::SystemDependentData_SharedPtr r2(r);
+ addOrReplaceSystemDependentDataInternal(r2);
+ }
+
return r;
}