summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@me.com>2020-01-22 17:20:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-05-23 17:07:04 +0100
commitd57bbeb0501c2d1864712b035b150c68fa18a3d2 (patch)
treeb237c45239b9d7435ff58164aac4508fb572ac4e /include
parentcb6ad65c07089a13d2aa6d664dddecd887336ab9 (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;
}