summaryrefslogtreecommitdiff
path: root/vcl/headless
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 /vcl/headless
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 'vcl/headless')
-rw-r--r--vcl/headless/svpgdi.cxx37
1 files changed, 24 insertions, 13 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index ea70321ff2fa..e12c7a32c8bd 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1036,27 +1036,36 @@ void SvpSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
class SystemDependentData_CairoPath : public basegfx::SystemDependentData
{
private:
+ // the path data itself
cairo_path_t* mpCairoPath;
- bool mbPixelSnapHairline;
+
+ // all other values the path data is based on and
+ // need to be compared with to check for data validity
+ bool mbNoJoin;
+ bool mbAntiAliasB2DDraw;
public:
SystemDependentData_CairoPath(
basegfx::SystemDependentDataManager& rSystemDependentDataManager,
- cairo_path_t* pCairoPath);
+ cairo_path_t* pCairoPath,
+ bool bNoJoin,
+ bool bAntiAliasB2DDraw);
virtual ~SystemDependentData_CairoPath() override;
cairo_path_t* getCairoPath() { return mpCairoPath; }
-
- bool getPixelSnapHairline() const { return mbPixelSnapHairline; }
- void setPixelSnapHairline(bool bNew) { mbPixelSnapHairline = bNew; }
+ bool getNoJoin() const { return mbNoJoin; }
+ bool getAntiAliasB2DDraw() const { return mbAntiAliasB2DDraw; }
};
SystemDependentData_CairoPath::SystemDependentData_CairoPath(
basegfx::SystemDependentDataManager& rSystemDependentDataManager,
- cairo_path_t* pCairoPath)
+ cairo_path_t* pCairoPath,
+ bool bNoJoin,
+ bool bAntiAliasB2DDraw)
: basegfx::SystemDependentData(rSystemDependentDataManager),
mpCairoPath(pCairoPath),
- mbPixelSnapHairline(false)
+ mbNoJoin(bNoJoin),
+ mbAntiAliasB2DDraw(bAntiAliasB2DDraw)
{
}
@@ -1246,7 +1255,8 @@ bool SvpSalGraphics::drawPolyLine(
{
// check data validity
if(nullptr == pSystemDependentData_CairoPath->getCairoPath()
- || pSystemDependentData_CairoPath->getPixelSnapHairline() != bPixelSnapHairline)
+ || pSystemDependentData_CairoPath->getNoJoin() != bNoJoin
+ || pSystemDependentData_CairoPath->getAntiAliasB2DDraw() != bAntiAliasB2DDraw)
{
// data invalid, forget
pSystemDependentData_CairoPath.reset();
@@ -1303,10 +1313,9 @@ bool SvpSalGraphics::drawPolyLine(
// copy and add to buffering mechanism
pSystemDependentData_CairoPath = rPolyLine.addOrReplaceSystemDependentData<SystemDependentData_CairoPath>(
ImplGetSystemDependentDataManager(),
- cairo_copy_path(cr));
-
- // fill data of buffered data
- pSystemDependentData_CairoPath->setPixelSnapHairline(bPixelSnapHairline);
+ cairo_copy_path(cr),
+ bNoJoin,
+ bAntiAliasB2DDraw);
}
// extract extents
@@ -1416,7 +1425,9 @@ bool SvpSalGraphics::drawPolyPolygon(
// for decisions how/what to buffer, see Note in WinSalGraphicsImpl::drawPolyPolygon
pSystemDependentData_CairoPath = rPolyPolygon.addOrReplaceSystemDependentData<SystemDependentData_CairoPath>(
ImplGetSystemDependentDataManager(),
- cairo_copy_path(cr));
+ cairo_copy_path(cr),
+ false,
+ false);
}
// To make releaseCairoContext work, use empty extents