diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-25 15:05:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-25 20:05:10 +0200 |
commit | 28993c0a8d8628c650b661767fd8ab2228c507d9 (patch) | |
tree | 74777bc270aae8bf1e7c5dc866a0817aea8c71e1 /drawinglayer | |
parent | 2b71e0683cf8a34aaddce3558b941ba62b1b4ec5 (diff) |
use officecfg for drawing options
Change-Id: Idba40d9816f29c0e4bc4a468b8c0a2cbb74d09d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119481
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
8 files changed, 18 insertions, 33 deletions
diff --git a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx index 4db2bde555c8..aace2ef87742 100644 --- a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx +++ b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx @@ -22,7 +22,6 @@ #include <drawinglayer/processor3d/baseprocessor3d.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/color/bcolormodifier.hxx> -#include <svtools/optionsdrawinglayer.hxx> // predefines @@ -83,9 +82,6 @@ namespace drawinglayer::processor3d /// the current active transparence texture std::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx; - /// SvtOptionsDrawinglayer incarnation to react on diverse settings - const SvtOptionsDrawinglayer maDrawinglayerOpt; - /// counter for entered transparence textures sal_uInt32 mnTransparenceCounter; @@ -133,9 +129,6 @@ namespace drawinglayer::processor3d bool getModulate() const { return mbModulate; } bool getFilter() const { return mbFilter; } bool getSimpleTextureActive() const { return mbSimpleTextureActive; } - - /// access to Drawinglayer configuration options - const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } }; } // end of namespace drawinglayer::processor3d diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 26e42a17cdd1..5421a696742b 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -96,8 +96,7 @@ namespace drawinglayer::primitive2d basegfx::B2DVector aDiscreteSize(rViewInformation.getObjectToViewTransformation() * aScale); // limit to a maximum square size, e.g. 300x150 pixels (45000) - const SvtOptionsDrawinglayer aDrawinglayerOpt; - const double fDiscreteMax(aDrawinglayerOpt.GetQuadraticFormControlRenderLimit()); + const double fDiscreteMax(SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit()); const double fDiscreteQuadratic(aDiscreteSize.getX() * aDiscreteSize.getY()); const bool bScaleUsed(fDiscreteQuadratic > fDiscreteMax); double fFactor(1.0); diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 27f2f5a3638a..9c8cc2b39c71 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -243,8 +243,7 @@ namespace drawinglayer::primitive2d double fViewSizeX(aVisibleDiscreteRange.getWidth()); double fViewSizeY(aVisibleDiscreteRange.getHeight()); const double fViewVisibleArea(fViewSizeX * fViewSizeY); - const SvtOptionsDrawinglayer aDrawinglayerOpt; - const double fMaximumVisibleArea(aDrawinglayerOpt.GetQuadratic3DRenderLimit()); + const double fMaximumVisibleArea(SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit()); double fReduceFactor(1.0); if(fViewVisibleArea > fMaximumVisibleArea) @@ -282,7 +281,7 @@ namespace drawinglayer::primitive2d // determine the oversample value static const sal_uInt16 nDefaultOversampleValue(3); - const sal_uInt16 nOversampleValue(aDrawinglayerOpt.IsAntiAliasing() ? nDefaultOversampleValue : 0); + const sal_uInt16 nOversampleValue(SvtOptionsDrawinglayer::IsAntiAliasing() ? nDefaultOversampleValue : 0); geometry::ViewInformation3D aViewInformation3D(getViewInformation3D()); { diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 9bdbf95a015b..a0990edf7645 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -61,6 +61,7 @@ #include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/awt/XControl.hpp> +#include <svtools/optionsdrawinglayer.hxx> #include <vcl/gradient.hxx> using namespace com::sun::star; @@ -91,7 +92,7 @@ VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rVie mpOutputDevice->SetMapMode(); // react on AntiAliasing settings - if (getOptionsDrawinglayer().IsAntiAliasing()) + if (SvtOptionsDrawinglayer::IsAntiAliasing()) { mpOutputDevice->SetAntialiasing(m_pImpl->m_nOrigAntiAliasing | AntialiasingFlags::Enable); } @@ -455,7 +456,7 @@ void VclPixelProcessor2D::processTextSimplePortionPrimitive2D( const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode()); adaptTextToFillDrawMode(); - if (getOptionsDrawinglayer().IsRenderSimpleTextDirect()) + if (SvtOptionsDrawinglayer::IsRenderSimpleTextDirect()) { RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate); } @@ -475,7 +476,7 @@ void VclPixelProcessor2D::processTextDecoratedPortionPrimitive2D( const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode()); adaptTextToFillDrawMode(); - if (getOptionsDrawinglayer().IsRenderDecoratedTextDirect()) + if (SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect()) { RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate); } @@ -563,7 +564,7 @@ void VclPixelProcessor2D::processPolyPolygonColorPrimitive2D( // when AA is on and this filled polygons are the result of stroked line geometry, // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons // Caution: This is needed in both cases (!) - if (!(mnPolygonStrokePrimitive2D && getOptionsDrawinglayer().IsAntiAliasing() + if (!(mnPolygonStrokePrimitive2D && SvtOptionsDrawinglayer::IsAntiAliasing() && (mpOutputDevice->GetAntialiasing() & AntialiasingFlags::Enable))) return; @@ -784,7 +785,7 @@ void VclPixelProcessor2D::processPolygonStrokePrimitive2D( void VclPixelProcessor2D::processFillHatchPrimitive2D( const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive) { - if (getOptionsDrawinglayer().IsAntiAliasing()) + if (SvtOptionsDrawinglayer::IsAntiAliasing()) { // if AA is used (or ignore smoothing is on), there is no need to smooth // hatch painting, use decomposition @@ -951,8 +952,8 @@ void VclPixelProcessor2D::processInvertPrimitive2D(const primitive2d::BasePrimit void VclPixelProcessor2D::processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { // #i98289# - const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() - && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()); + const bool bForceLineSnap(SvtOptionsDrawinglayer::IsAntiAliasing() + && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()); const AntialiasingFlags nOldAntiAliase(mpOutputDevice->GetAntialiasing()); if (bForceLineSnap) diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 5bd7e0194b66..bd6af1b27221 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -23,6 +23,7 @@ #include "vclhelperbufferdevice.hxx" #include <cmath> #include <comphelper/string.hxx> +#include <svtools/optionsdrawinglayer.hxx> #include <tools/debug.hxx> #include <vcl/graph.hxx> #include <vcl/outdev.hxx> @@ -346,8 +347,8 @@ void VclProcessor2D::RenderPolygonHairlinePrimitive2D( basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon()); aLocalPolygon.transform(maCurrentTransformation); - if (bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() - && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()) + if (bPixelBased && SvtOptionsDrawinglayer::IsAntiAliasing() + && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()) { // #i98289# // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete @@ -765,7 +766,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive aMask.transform(maCurrentTransformation); // Unless smooth edges are needed, simply use clipping. - if (basegfx::utils::isRectangle(aMask) || !getOptionsDrawinglayer().IsAntiAliasing()) + if (basegfx::utils::isRectangle(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing()) { mpOutputDevice->Push(PushFlags::CLIPREGION); mpOutputDevice->IntersectClipRegion(vcl::Region(aMask)); @@ -1042,7 +1043,7 @@ void VclProcessor2D::RenderPolygonStrokePrimitive2D( if (nCount) { - const bool bAntiAliased(getOptionsDrawinglayer().IsAntiAliasing()); + const bool bAntiAliased(SvtOptionsDrawinglayer::IsAntiAliasing()); aHairlinePolyPolygon.transform(maCurrentTransformation); if (bAntiAliased) @@ -1475,7 +1476,6 @@ VclProcessor2D::VclProcessor2D(const geometry::ViewInformation2D& rViewInformati , mpOutputDevice(&rOutDev) , maBColorModifierStack(rInitStack) , maCurrentTransformation() - , maDrawinglayerOpt() , mnPolygonStrokePrimitive2D(0) , mpObjectInfoPrimitive2D(nullptr) { diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx index dbca9ed4ba25..7e251aa0ca13 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.hxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx @@ -22,7 +22,6 @@ #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/color/bcolormodifier.hxx> -#include <svtools/optionsdrawinglayer.hxx> #include <vcl/vclptr.hxx> class OutputDevice; @@ -73,9 +72,6 @@ protected: // ViewInformation2D cannot directly be used, but needs to be kept up to date basegfx::B2DHomMatrix maCurrentTransformation; - // SvtOptionsDrawinglayer incarnation to react on diverse settings - const SvtOptionsDrawinglayer maDrawinglayerOpt; - // stack value (increment and decrement) to count how deep we are in // PolygonStrokePrimitive2D's decompositions (normally only one) sal_uInt32 mnPolygonStrokePrimitive2D; @@ -124,9 +120,6 @@ public: const basegfx::BColorModifierStack& rInitStack = basegfx::BColorModifierStack()); virtual ~VclProcessor2D() override; - // access to Drawinglayer configuration options - const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; } - // access to currently used ObjectInfoPrimitive2D const primitive2d::ObjectInfoPrimitive2D* getObjectInfoPrimitive2D() const { diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 51dfefb6ac5d..7e8191d6dccf 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -581,7 +581,6 @@ namespace drawinglayer::processor3d maBColorModifierStack(), mpGeoTexSvx(), mpTransparenceGeoTexSvx(), - maDrawinglayerOpt(), mnTransparenceCounter(0), mbModulate(false), mbFilter(false), diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 56cfc3c45c18..b2a6422b556e 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -27,6 +27,7 @@ #include <basegfx/polygon/b3dpolygontools.hxx> #include <basegfx/polygon/b3dpolypolygontools.hxx> #include <drawinglayer/attribute/sdrlightingattribute3d.hxx> +#include <svtools/optionsdrawinglayer.hxx> using namespace com::sun::star; @@ -440,7 +441,7 @@ namespace drawinglayer::processor3d if(mnAntiAlialize > 1) { - const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete()); + const bool bForceLineSnap(SvtOptionsDrawinglayer::IsAntiAliasing() && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()); if(bForceLineSnap) { |