diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2022-11-06 13:57:11 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2022-11-08 11:16:30 +0100 |
commit | 444bf8710d5da7b584fbcb94693e4ed8d2e29297 (patch) | |
tree | b785047790b44ae5b8ce4d3166d8edfe8f691568 /drawinglayer | |
parent | b9eaed7a4c484dde0b5c61b34b4beb60a101f661 (diff) |
Update handling of AntiAliasing settings and processor2d
Currently SvtOptionsDrawinglayer::IsAntiAliasing() is used
in the constructor of the VCL based processor2Ds to decide
if AA is to be used or not. Using this inside the
constructors makes it currently impossible to use a
primitive renderer independent from these settings,
except when changing these settings temporarily what
may influence other renderings and is a hack.
The setting SvtOptionsDrawinglayer::IsAntiAliasing() is
intended to decide if LO shall use AA mode from user's
perspective, this means for the EditViews of the Apps
and some other occasions (previews, exports, conversions
to bitmap, ...).
This works currently since all visualizations for these
purposes use newly constructed primitive renderers. But
there is no way to use primitive renderers independent
from that setting. For future renderers which might be
used for other purposes this is not sufficient, there
has to be a method to create a renderer using e.g. AA
independent of the global setting.
To allow that, move the deciding flag to the already
used geometry::ViewInformation2D. To not change anything
initially, use the global flag for now to init that
default value at ViewInformation2D.
I took the opportunity to adapt ViewInformation2D to
no longer being read-only and not changeable, it uses
internally an impl class based on cow_wrapper already
anyways. Extending this would lead to the constructors
getting even bigger, when usually only 1-3 values
need to be changed and many usages want to copy an
existing instance and modify it. Adapted that usages
to a much smaller footprint.
Up to this point this does not change anything, but
move the usage of the SvtOptionsDrawinglayer to the
defaults (constructors) of the involved class
ViewInformation2D. Using this then in the primitive
rederers should be safe and will allow to use a
primitive renderer with or without AntiAliasing
independent of the user setting, so also for non-
EditView usages.
Also already added the PixelSnapHairline setting, this
will also be needed independent of user settings to
have full freedom of usage.
Unfortunately I cannot use SvtOptionsDrawinglayer
methods
::IsAntiAliasing() or
::IsSnapHorVerLinesToDiscrete
inside ViewInformation2D where I would need it. It's
now in drawinglayercore and thus not linked against
svtools (svt) anymore.
Thus I have to do some forwarding mechanisms to get
the correct values available in ViewInformation2D.
Not nice, caused by creating drawinglayercore...
Change-Id: I9f572ce67e5d86a242188bdc6d4ba7c9a12f6a9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142393
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer')
10 files changed, 207 insertions, 90 deletions
diff --git a/drawinglayer/Library_drawinglayercore.mk b/drawinglayer/Library_drawinglayercore.mk index 9e089e9a0760..7ec954416a23 100644 --- a/drawinglayer/Library_drawinglayercore.mk +++ b/drawinglayer/Library_drawinglayercore.mk @@ -39,6 +39,10 @@ $(eval $(call gb_Library_use_libraries,drawinglayercore,\ tl \ )) +$(eval $(call gb_Library_use_custom_headers,drawinglayercore,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_add_exception_objects,drawinglayercore,\ drawinglayer/source/primitive2d/baseprimitive2d \ drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D \ diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx index 6de309286d9d..d23dda648bed 100644 --- a/drawinglayer/source/geometry/viewinformation2d.cxx +++ b/drawinglayer/source/geometry/viewinformation2d.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/geometry/AffineMatrix2D.hpp> #include <com/sun/star/geometry/RealRectangle2D.hpp> +#include <officecfg/Office/Common.hxx> #include <utility> using namespace com::sun::star; @@ -39,6 +40,15 @@ constexpr OUStringLiteral g_PropertyName_Viewport = u"Viewport"; constexpr OUStringLiteral g_PropertyName_Time = u"Time"; constexpr OUStringLiteral g_PropertyName_VisualizedPage = u"VisualizedPage"; constexpr OUStringLiteral g_PropertyName_ReducedDisplayQuality = u"ReducedDisplayQuality"; +constexpr OUStringLiteral g_PropertyName_UseAntiAliasing = u"UseAntiAliasing"; +constexpr OUStringLiteral g_PropertyName_PixelSnapHairline = u"PixelSnapHairline"; +} + +namespace +{ +bool bForwardsAreInitialized(false); +bool bForwardedAntiAliasing(true); +bool bForwardPixelSnapHairline(true); } class ImpViewInformation2D @@ -74,34 +84,54 @@ protected: // the point in time double mfViewTime; + // allow to reduce DisplayQuality (e.g. sw 3d fallback renderer for interactions) bool mbReducedDisplayQuality : 1; -public: - ImpViewInformation2D(basegfx::B2DHomMatrix aObjectTransformation, - basegfx::B2DHomMatrix aViewTransformation, - const basegfx::B2DRange& rViewport, - uno::Reference<drawing::XDrawPage> xDrawPage, double fViewTime, - bool bReducedDisplayQuality) - : maObjectTransformation(std::move(aObjectTransformation)) - , maViewTransformation(std::move(aViewTransformation)) - , maViewport(rViewport) - , mxVisualizedPage(std::move(xDrawPage)) - , mfViewTime(fViewTime) - , mbReducedDisplayQuality(bReducedDisplayQuality) - { - } + // determine if to use AntiAliasing on target pixel device + bool mbUseAntiAliasing : 1; + // determine if to use PixelSnapHairline on target pixel device + bool mbPixelSnapHairline : 1; + +public: ImpViewInformation2D() - : mfViewTime(0.0) + : maObjectTransformation() + , maViewTransformation() + , maObjectToViewTransformation() + , maInverseObjectToViewTransformation() + , maViewport() + , maDiscreteViewport() + , mxVisualizedPage() + , mfViewTime(0.0) , mbReducedDisplayQuality(false) + , mbUseAntiAliasing(bForwardedAntiAliasing) + , mbPixelSnapHairline(bForwardedAntiAliasing && bForwardPixelSnapHairline) { } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } + void setObjectTransformation(const basegfx::B2DHomMatrix& rNew) + { + maObjectTransformation = rNew; + maObjectToViewTransformation.identity(); + maInverseObjectToViewTransformation.identity(); + } const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; } + void setViewTransformation(const basegfx::B2DHomMatrix& rNew) + { + maViewTransformation = rNew; + maDiscreteViewport.reset(); + maObjectToViewTransformation.identity(); + maInverseObjectToViewTransformation.identity(); + } const basegfx::B2DRange& getViewport() const { return maViewport; } + void setViewport(const basegfx::B2DRange& rNew) + { + maViewport = rNew; + maDiscreteViewport.reset(); + } const basegfx::B2DRange& getDiscreteViewport() const { @@ -143,10 +173,28 @@ public: } double getViewTime() const { return mfViewTime; } + void setViewTime(double fNew) + { + if (fNew >= 0.0) + { + mfViewTime = fNew; + } + } const uno::Reference<drawing::XDrawPage>& getVisualizedPage() const { return mxVisualizedPage; } + void setVisualizedPage(const uno::Reference<drawing::XDrawPage>& rNew) + { + mxVisualizedPage = rNew; + } bool getReducedDisplayQuality() const { return mbReducedDisplayQuality; } + void setReducedDisplayQuality(bool bNew) { mbReducedDisplayQuality = bNew; } + + bool getUseAntiAliasing() const { return mbUseAntiAliasing; } + void setUseAntiAliasing(bool bNew) { mbUseAntiAliasing = bNew; } + + bool getPixelSnapHairline() const { return mbPixelSnapHairline; } + void setPixelSnapHairline(bool bNew) { mbPixelSnapHairline = bNew; } bool operator==(const ImpViewInformation2D& rCandidate) const { @@ -154,7 +202,10 @@ public: && maViewTransformation == rCandidate.maViewTransformation && maViewport == rCandidate.maViewport && mxVisualizedPage == rCandidate.mxVisualizedPage - && mfViewTime == rCandidate.mfViewTime); + && mfViewTime == rCandidate.mfViewTime + && mbReducedDisplayQuality == rCandidate.mbReducedDisplayQuality + && mbUseAntiAliasing == rCandidate.mbUseAntiAliasing + && mbPixelSnapHairline == rCandidate.mbPixelSnapHairline); } }; @@ -167,20 +218,19 @@ ViewInformation2D::ImplType& theGlobalDefault() } } -ViewInformation2D::ViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation, - const basegfx::B2DHomMatrix& rViewTransformation, - const basegfx::B2DRange& rViewport, - const uno::Reference<drawing::XDrawPage>& rxDrawPage, - double fViewTime, bool bReducedDisplayQuality) - : mpViewInformation2D(ImpViewInformation2D(rObjectTransformation, rViewTransformation, - rViewport, rxDrawPage, fViewTime, - bReducedDisplayQuality)) -{ -} - ViewInformation2D::ViewInformation2D() : mpViewInformation2D(theGlobalDefault()) { + if (!bForwardsAreInitialized) + { + bForwardsAreInitialized = true; + bForwardedAntiAliasing = officecfg::Office::Common::Drawinglayer::AntiAliasing::get(); + bForwardPixelSnapHairline + = officecfg::Office::Common::Drawinglayer::SnapHorVerLinesToDiscrete::get(); + } + + setUseAntiAliasing(bForwardedAntiAliasing); + setPixelSnapHairline(bForwardPixelSnapHairline); } ViewInformation2D::ViewInformation2D(const ViewInformation2D&) = default; @@ -203,23 +253,53 @@ const basegfx::B2DHomMatrix& ViewInformation2D::getObjectTransformation() const return mpViewInformation2D->getObjectTransformation(); } +void ViewInformation2D::setObjectTransformation(const basegfx::B2DHomMatrix& rNew) +{ + if (std::as_const(mpViewInformation2D)->getObjectTransformation() != rNew) + mpViewInformation2D->setObjectTransformation(rNew); +} + const basegfx::B2DHomMatrix& ViewInformation2D::getViewTransformation() const { return mpViewInformation2D->getViewTransformation(); } +void ViewInformation2D::setViewTransformation(const basegfx::B2DHomMatrix& rNew) +{ + if (std::as_const(mpViewInformation2D)->getViewTransformation() != rNew) + mpViewInformation2D->setViewTransformation(rNew); +} + const basegfx::B2DRange& ViewInformation2D::getViewport() const { return mpViewInformation2D->getViewport(); } +void ViewInformation2D::setViewport(const basegfx::B2DRange& rNew) +{ + if (rNew != std::as_const(mpViewInformation2D)->getViewport()) + mpViewInformation2D->setViewport(rNew); +} + double ViewInformation2D::getViewTime() const { return mpViewInformation2D->getViewTime(); } +void ViewInformation2D::setViewTime(double fNew) +{ + if (fNew != std::as_const(mpViewInformation2D)->getViewTime()) + mpViewInformation2D->setViewTime(fNew); +} + const uno::Reference<drawing::XDrawPage>& ViewInformation2D::getVisualizedPage() const { return mpViewInformation2D->getVisualizedPage(); } +void ViewInformation2D::setVisualizedPage(const uno::Reference<drawing::XDrawPage>& rNew) +{ + if (rNew != std::as_const(mpViewInformation2D)->getVisualizedPage()) + mpViewInformation2D->setVisualizedPage(rNew); +} + const basegfx::B2DHomMatrix& ViewInformation2D::getObjectToViewTransformation() const { return mpViewInformation2D->getObjectToViewTransformation(); @@ -240,55 +320,112 @@ bool ViewInformation2D::getReducedDisplayQuality() const return mpViewInformation2D->getReducedDisplayQuality(); } +void ViewInformation2D::setReducedDisplayQuality(bool bNew) +{ + if (bNew != std::as_const(mpViewInformation2D)->getReducedDisplayQuality()) + mpViewInformation2D->setReducedDisplayQuality(bNew); +} + +bool ViewInformation2D::getUseAntiAliasing() const +{ + return mpViewInformation2D->getUseAntiAliasing(); +} + +void ViewInformation2D::setUseAntiAliasing(bool bNew) +{ + if (bNew != std::as_const(mpViewInformation2D)->getUseAntiAliasing()) + mpViewInformation2D->setUseAntiAliasing(bNew); +} + +bool ViewInformation2D::getPixelSnapHairline() const +{ + return mpViewInformation2D->getPixelSnapHairline(); +} + +void ViewInformation2D::setPixelSnapHairline(bool bNew) +{ + if (bNew != std::as_const(mpViewInformation2D)->getPixelSnapHairline()) + mpViewInformation2D->setPixelSnapHairline(bNew); +} + +void ViewInformation2D::forwardAntiAliasing(bool bAntiAliasing) +{ + bForwardedAntiAliasing = bAntiAliasing; +} + +void ViewInformation2D::forwardPixelSnapHairline(bool bPixelSnapHairline) +{ + bForwardPixelSnapHairline = bPixelSnapHairline; +} + ViewInformation2D createViewInformation2D(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters) { if (!rViewParameters.hasElements()) return ViewInformation2D(); - bool bReducedDisplayQuality = false; - basegfx::B2DHomMatrix aObjectTransformation; - basegfx::B2DHomMatrix aViewTransformation; - basegfx::B2DRange aViewport; - double fViewTime = 0.0; - uno::Reference<drawing::XDrawPage> xVisualizedPage; + ViewInformation2D aRetval; for (auto const& rPropertyValue : rViewParameters) { if (rPropertyValue.Name == g_PropertyName_ReducedDisplayQuality) { - rPropertyValue.Value >>= bReducedDisplayQuality; + bool bNew(false); + rPropertyValue.Value >>= bNew; + aRetval.setReducedDisplayQuality(bNew); + } + else if (rPropertyValue.Name == g_PropertyName_PixelSnapHairline) + { + bool bNew( + true); //SvtOptionsDrawinglayer::IsAntiAliasing() && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()); + rPropertyValue.Value >>= bNew; + aRetval.setPixelSnapHairline(bNew); + } + else if (rPropertyValue.Name == g_PropertyName_UseAntiAliasing) + { + bool bNew(true); //SvtOptionsDrawinglayer::IsAntiAliasing()); + rPropertyValue.Value >>= bNew; + aRetval.setUseAntiAliasing(bNew); } else if (rPropertyValue.Name == g_PropertyName_ObjectTransformation) { css::geometry::AffineMatrix2D aAffineMatrix2D; rPropertyValue.Value >>= aAffineMatrix2D; - basegfx::unotools::homMatrixFromAffineMatrix(aObjectTransformation, aAffineMatrix2D); + basegfx::B2DHomMatrix aTransformation; + basegfx::unotools::homMatrixFromAffineMatrix(aTransformation, aAffineMatrix2D); + aRetval.setObjectTransformation(aTransformation); } else if (rPropertyValue.Name == g_PropertyName_ViewTransformation) { css::geometry::AffineMatrix2D aAffineMatrix2D; rPropertyValue.Value >>= aAffineMatrix2D; - basegfx::unotools::homMatrixFromAffineMatrix(aViewTransformation, aAffineMatrix2D); + basegfx::B2DHomMatrix aTransformation; + basegfx::unotools::homMatrixFromAffineMatrix(aTransformation, aAffineMatrix2D); + aRetval.setViewTransformation(aTransformation); } else if (rPropertyValue.Name == g_PropertyName_Viewport) { css::geometry::RealRectangle2D aUnoViewport; rPropertyValue.Value >>= aUnoViewport; - aViewport = basegfx::unotools::b2DRectangleFromRealRectangle2D(aUnoViewport); + const basegfx::B2DRange aViewport( + basegfx::unotools::b2DRectangleFromRealRectangle2D(aUnoViewport)); + aRetval.setViewport(aViewport); } else if (rPropertyValue.Name == g_PropertyName_Time) { + double fViewTime(0.0); rPropertyValue.Value >>= fViewTime; + aRetval.setViewTime(fViewTime); } else if (rPropertyValue.Name == g_PropertyName_VisualizedPage) { + css::uno::Reference<css::drawing::XDrawPage> xVisualizedPage; rPropertyValue.Value >>= xVisualizedPage; + aRetval.setVisualizedPage(xVisualizedPage); } } - return ViewInformation2D(aObjectTransformation, aViewTransformation, aViewport, xVisualizedPage, - fViewTime, bReducedDisplayQuality); + return aRetval; } } // end of namespace drawinglayer::geometry diff --git a/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx b/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx index 0a3249399a44..3c45fdd030f4 100644 --- a/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx +++ b/drawinglayer/source/primitive2d/GlowSoftEgdeShadowTools.cxx @@ -79,14 +79,11 @@ drawinglayer::geometry::ViewInformation2D expandB2DRangeAtViewInformation2D(const drawinglayer::geometry::ViewInformation2D& rViewInfo, double nAmount) { + drawinglayer::geometry::ViewInformation2D aRetval(rViewInfo); basegfx::B2DRange viewport(rViewInfo.getViewport()); viewport.grow(nAmount); - return { rViewInfo.getObjectTransformation(), - rViewInfo.getViewTransformation(), - viewport, - rViewInfo.getVisualizedPage(), - rViewInfo.getViewTime(), - rViewInfo.getReducedDisplayQuality() }; + aRetval.setViewport(viewport); + return aRetval; } } // end of namespace drawinglayer::primitive2d diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx index a1d1200183cc..65e8ef86a29e 100644 --- a/drawinglayer/source/processor2d/contourextractor2d.cxx +++ b/drawinglayer/source/processor2d/contourextractor2d.cxx @@ -123,12 +123,8 @@ namespace drawinglayer::processor2d const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); // create new local ViewInformation2D - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(), - getViewInformation2D().getViewTransformation(), - getViewInformation2D().getViewport(), - getViewInformation2D().getVisualizedPage(), - getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setObjectTransformation(getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation()); updateViewInformation(aViewInformation2D); // process content diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index dc7d6fa7cb3f..1ebc8d541619 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -233,12 +233,8 @@ namespace drawinglayer::processor2d const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); // create new local ViewInformation2D containing transformation - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(), - getViewInformation2D().getViewTransformation(), - getViewInformation2D().getViewport(), - getViewInformation2D().getVisualizedPage(), - getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setObjectTransformation(getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation()); updateViewInformation(aViewInformation2D); // process child content recursively diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx index 08ec1232d137..11af79725b41 100644 --- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx +++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx @@ -84,12 +84,8 @@ namespace drawinglayer::processor2d const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); // create new transformations for CurrentTransformation and for local ViewInformation2D - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(), - getViewInformation2D().getViewTransformation(), - getViewInformation2D().getViewport(), - getViewInformation2D().getVisualizedPage(), - getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setObjectTransformation(getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation()); updateViewInformation(aViewInformation2D); // process content diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx index fcf15b189ed2..c98fae69d301 100644 --- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx +++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx @@ -177,12 +177,8 @@ namespace drawinglayer::processor2d const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); // create new transformations for CurrentTransformation and for local ViewInformation2D - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(), - getViewInformation2D().getViewTransformation(), - getViewInformation2D().getViewport(), - getViewInformation2D().getVisualizedPage(), - getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setObjectTransformation(getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation()); updateViewInformation(aViewInformation2D); // process content diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index a231e20153ef..539e01282a2f 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -2321,9 +2321,9 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D( // create view information and pixel renderer. Reuse known ViewInformation // except new transformation and range - const geometry::ViewInformation2D aViewInfo( - getViewInformation2D().getObjectTransformation(), aViewTransform, aViewRange, - getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInfo(getViewInformation2D()); + aViewInfo.setViewTransformation(aViewTransform); + aViewInfo.setViewport(aViewRange); VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice); diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 564b113d8f86..f701ad9bbeeb 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -83,7 +83,7 @@ VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rVie mpOutputDevice->SetMapMode(); // react on AntiAliasing settings - if (SvtOptionsDrawinglayer::IsAntiAliasing()) + if (rViewInformation.getUseAntiAliasing()) { mpOutputDevice->SetAntialiasing(m_nOrigAntiAliasing | AntialiasingFlags::Enable); } @@ -543,7 +543,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 && SvtOptionsDrawinglayer::IsAntiAliasing() + if (!(mnPolygonStrokePrimitive2D && getViewInformation2D().getUseAntiAliasing() && (mpOutputDevice->GetAntialiasing() & AntialiasingFlags::Enable))) return; @@ -758,7 +758,7 @@ void VclPixelProcessor2D::processPolygonStrokePrimitive2D( void VclPixelProcessor2D::processFillHatchPrimitive2D( const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive) { - if (SvtOptionsDrawinglayer::IsAntiAliasing()) + if (getViewInformation2D().getUseAntiAliasing()) { // if AA is used (or ignore smoothing is on), there is no need to smooth // hatch painting, use decomposition @@ -925,8 +925,7 @@ void VclPixelProcessor2D::processInvertPrimitive2D(const primitive2d::BasePrimit void VclPixelProcessor2D::processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { // #i98289# - const bool bForceLineSnap(SvtOptionsDrawinglayer::IsAntiAliasing() - && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()); + const bool bForceLineSnap(getViewInformation2D().getPixelSnapHairline()); const AntialiasingFlags nOldAntiAliase(mpOutputDevice->GetAntialiasing()); if (bForceLineSnap) @@ -1045,7 +1044,7 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D( tools::Rectangle aMaskRect = vcl::unotools::rectangleFromB2DRectangle(aMaskRange); // Unless smooth edges are needed, simply use clipping. - if (basegfx::utils::isRectangle(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing()) + if (basegfx::utils::isRectangle(aMask) || !getViewInformation2D().getUseAntiAliasing()) { mpOutputDevice->Push(vcl::PushFlags::CLIPREGION); mpOutputDevice->IntersectClipRegion(vcl::Region(aMask)); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index a8874453bd4f..77c35caa1e27 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -407,8 +407,7 @@ void VclProcessor2D::RenderPolygonHairlinePrimitive2D( basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon()); aLocalPolygon.transform(maCurrentTransformation); - if (bPixelBased && SvtOptionsDrawinglayer::IsAntiAliasing() - && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete()) + if (bPixelBased && getViewInformation2D().getPixelSnapHairline()) { // #i98289# // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete @@ -818,7 +817,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive aMask.transform(maCurrentTransformation); // Unless smooth edges are needed, simply use clipping. - if (isRectangles(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing()) + if (isRectangles(aMask) || !getViewInformation2D().getUseAntiAliasing()) { mpOutputDevice->Push(vcl::PushFlags::CLIPREGION); mpOutputDevice->IntersectClipRegion(vcl::Region(aMask)); @@ -954,10 +953,9 @@ void VclProcessor2D::RenderTransformPrimitive2D( // create new transformations for CurrentTransformation // and for local ViewInformation2D maCurrentTransformation = maCurrentTransformation * rTransformCandidate.getTransformation(); - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation() * rTransformCandidate.getTransformation(), - getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(), - getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setObjectTransformation(getViewInformation2D().getObjectTransformation() + * rTransformCandidate.getTransformation()); updateViewInformation(aViewInformation2D); // process content @@ -976,10 +974,8 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D( const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); // create new local ViewInformation2D - const geometry::ViewInformation2D aViewInformation2D( - getViewInformation2D().getObjectTransformation(), - getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(), - rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime()); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setVisualizedPage(rPagePreviewCandidate.getXDrawPage()); updateViewInformation(aViewInformation2D); // process decomposed content @@ -1093,7 +1089,7 @@ void VclProcessor2D::RenderPolygonStrokePrimitive2D( if (nCount) { - const bool bAntiAliased(SvtOptionsDrawinglayer::IsAntiAliasing()); + const bool bAntiAliased(getViewInformation2D().getUseAntiAliasing()); aHairlinePolyPolygon.transform(maCurrentTransformation); if (bAntiAliased) |