diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-09-21 16:42:01 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-09-21 20:12:09 +0200 |
commit | 80b287ad0322afcbf8f80b0507e212870dcf0f98 (patch) | |
tree | 7710bc62dfc82d4b77d2f1de3beb55599c4e3527 /vcl/win | |
parent | c8b2849d140677f7b35523096eb2bc715b3dc507 (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/win')
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 0fde7b510486..017431ed7107 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -1954,24 +1954,31 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal( class SystemDependentData_GraphicsPath : public basegfx::SystemDependentData { private: + // the path data itself Gdiplus::GraphicsPath maGraphicsPath; - bool mbPixelSnapHairline; + + // all other values the triangulation is based on and + // need to be compared with to check for data validity + bool mbNoLineJoin; public: SystemDependentData_GraphicsPath( - basegfx::SystemDependentDataManager& rSystemDependentDataManager); - + basegfx::SystemDependentDataManager& rSystemDependentDataManager, + bool bNoLineJoin); + // non-const getter to allow manipulation. That way, we do not need + // to copy it (with unknown costs) Gdiplus::GraphicsPath& getGraphicsPath() { return maGraphicsPath; } - bool getPixelSnapHairline() const { return mbPixelSnapHairline; } - void setPixelSnapHairline(bool bNew) { mbPixelSnapHairline = bNew; } + // other data-validity access + bool getNoLineJoin() const { return mbNoLineJoin; } }; SystemDependentData_GraphicsPath::SystemDependentData_GraphicsPath( - basegfx::SystemDependentDataManager& rSystemDependentDataManager) + basegfx::SystemDependentDataManager& rSystemDependentDataManager, + bool bNoLineJoin) : basegfx::SystemDependentData(rSystemDependentDataManager), maGraphicsPath(), - mbPixelSnapHairline(false) + mbNoLineJoin(bNoLineJoin) { } @@ -2019,7 +2026,8 @@ bool WinSalGraphicsImpl::drawPolyPolygon( { // add to buffering mechanism pSystemDependentData_GraphicsPath = rPolyPolygon.addOrReplaceSystemDependentData<SystemDependentData_GraphicsPath>( - ImplGetSystemDependentDataManager()); + ImplGetSystemDependentDataManager(), + false); // Note: In principle we could use the same buffered geometry at line // and fill polygons. Checked that in a first try, used @@ -2221,7 +2229,7 @@ bool WinSalGraphicsImpl::drawPolyLine( if(pSystemDependentData_GraphicsPath) { // check data validity - if(pSystemDependentData_GraphicsPath->getPixelSnapHairline() != bPixelSnapHairline) + if(pSystemDependentData_GraphicsPath->getNoLineJoin() != bNoLineJoin) { // data invalid, forget pSystemDependentData_GraphicsPath.reset(); @@ -2232,11 +2240,10 @@ bool WinSalGraphicsImpl::drawPolyLine( { // add to buffering mechanism pSystemDependentData_GraphicsPath = rPolygon.addOrReplaceSystemDependentData<SystemDependentData_GraphicsPath>( - ImplGetSystemDependentDataManager()); + ImplGetSystemDependentDataManager(), + bNoLineJoin); // fill data of buffered data - pSystemDependentData_GraphicsPath->setPixelSnapHairline(bPixelSnapHairline); - impAddB2DPolygonToGDIPlusGraphicsPathReal( pSystemDependentData_GraphicsPath->getGraphicsPath(), rPolygon, |