[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 3 commits - basegfx/Library_basegfx.mk basegfx/source drawinglayer/inc drawinglayer/Library_drawinglayer.mk drawinglayer/qa drawinglayer/source include/basegfx include/drawinglayer offapi/com sc/source sd/source sfx2/source svgio/source svx/source sw/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 2 07:13:31 UTC 2021
Rebased ref, commits from common ancestor:
commit ff131fb0277ad9d85b2436cd4baa6ded9b455f34
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Apr 2 16:11:50 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Fri Apr 2 16:11:50 2021 +0900
drawinglayer: ITextLayouter and use it as a VisitingParameter
Change-Id: I04aa42716c2bde4a2652d10892b6b2392a20fb3b
diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index 8359969ae80c..957f1b45ac08 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
basegfx/source/vector/b2dvector \
basegfx/source/vector/b2ivector \
basegfx/source/vector/b3dvector \
+ basegfx/source/text/UnoTextLayouter \
))
diff --git a/basegfx/source/text/UnoTextLayouter.cxx b/basegfx/source/text/UnoTextLayouter.cxx
new file mode 100644
index 000000000000..e3f48264c624
--- /dev/null
+++ b/basegfx/source/text/UnoTextLayouter.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <basegfx/text/UnoTextLayouter.hxx>
+#include <cppuhelper/queryinterface.hxx>
+
+using namespace css;
+
+namespace gfx
+{
+// css::lang::XUnoTunnel
+UNO3_GETIMPLEMENTATION_IMPL(UnoTextLayouter);
+
+std::shared_ptr<gfx::ITextLayouter>
+getTextLayouterFromUno(uno::Reference<graphic::XTextLayouter> const& xTextLayouter)
+{
+ gfx::UnoTextLayouter* pUnoTextLayouter
+ = comphelper::getUnoTunnelImplementation<gfx::UnoTextLayouter>(xTextLayouter);
+ if (pUnoTextLayouter)
+ return pUnoTextLayouter->getTextLayouter();
+
+ return std::shared_ptr<gfx::ITextLayouter>();
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index e423b8367f1c..b14397fe9d87 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -112,15 +112,31 @@ FontAttribute::FontAttribute()
{
}
-FontAttribute::FontAttribute(const FontAttribute&) = default;
+FontAttribute::FontAttribute(const FontAttribute& rOther)
+ : mpFontAttribute(rOther.mpFontAttribute)
+{
+}
+
+FontAttribute::FontAttribute(FontAttribute&& rOther) noexcept
+ : mpFontAttribute(std::move(rOther.mpFontAttribute))
+{
+}
-FontAttribute::FontAttribute(FontAttribute&&) = default;
+FontAttribute::~FontAttribute() {}
-FontAttribute::~FontAttribute() = default;
+FontAttribute& FontAttribute::operator=(const FontAttribute& rOther)
+{
+ mpFontAttribute = rOther.mpFontAttribute;
-FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
+ return *this;
+}
-FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
+FontAttribute& FontAttribute::operator=(FontAttribute&& rOther) noexcept
+{
+ mpFontAttribute = std::move(rOther.mpFontAttribute);
+
+ return *this;
+}
bool FontAttribute::operator==(const FontAttribute& rCandidate) const
{
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 37fa2a2a477f..b424e1a5be13 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/geometry/RealRectangle2D.hpp>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <converters.hxx>
@@ -107,7 +108,8 @@ namespace drawinglayer::unorenderer
}
const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ auto pTextLayouter = std::make_shared<drawinglayer::processor2d::TextLayouterDevice>();
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, pTextLayouter);
const double fFactor100th_mmToInch(1.0 / (2.54 * 1000.0));
const sal_uInt32 nDiscreteWidth(basegfx::fround((fWidth * fFactor100th_mmToInch) * DPI_X));
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index b809574116cd..aa1c5fd4808a 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -23,7 +23,10 @@
#include <drawinglayer/primitive2d/Tools.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/utils/canvastools.hxx>
+#include <basegfx/text/UnoTextLayouter.hxx>
#include <comphelper/sequence.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <com/sun/star/graphic/XTextLayouter.hpp>
using namespace css;
@@ -85,12 +88,39 @@ void BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVis
{
}
+namespace
+{
+std::shared_ptr<gfx::ITextLayouter>
+getTextLayouter(const uno::Sequence<beans::PropertyValue>& rProperties)
+{
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter;
+
+ if (!rProperties.hasElements())
+ return pTextLayouter;
+
+ for (const beans::PropertyValue& rProperty : rProperties)
+ {
+ if (rProperty.Name == "TextLayouter")
+ {
+ uno::Reference<graphic::XTextLayouter> xTextLayouter;
+ rProperty.Value >>= xTextLayouter;
+ if (xTextLayouter.is())
+ pTextLayouter = gfx::getTextLayouterFromUno(xTextLayouter);
+ return pTextLayouter;
+ }
+ }
+ return pTextLayouter;
+}
+
+} // end anonymous namespace
+
css::uno::Sequence<::css::uno::Reference<::css::graphic::XPrimitive2D>> SAL_CALL
BasePrimitive2D::getDecomposition(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
Primitive2DContainer aContainer;
geometry::ViewInformation2D aViewInformation2D(rViewParameters);
- VisitingParameters aParameters(aViewInformation2D);
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter = getTextLayouter(rViewParameters);
+ VisitingParameters aParameters(aViewInformation2D, pTextLayouter);
get2DDecomposition(aContainer, aParameters);
return comphelper::containerToSequence(aContainer);
}
@@ -99,7 +129,8 @@ css::geometry::RealRectangle2D SAL_CALL
BasePrimitive2D::getRange(const uno::Sequence<beans::PropertyValue>& rViewParameters)
{
geometry::ViewInformation2D aViewInformation2D(rViewParameters);
- VisitingParameters aParameters(aViewInformation2D);
+ std::shared_ptr<gfx::ITextLayouter> pTextLayouter = getTextLayouter(rViewParameters);
+ VisitingParameters aParameters(aViewInformation2D, pTextLayouter);
return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aParameters));
}
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 10c893d21a1b..6a286685a39c 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -107,7 +107,7 @@ namespace drawinglayer::primitive2d
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
const geometry::ViewInformation2D aViewInformation2D;
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, rParameters.getTextLayouter());
const BitmapEx aBitmapEx(
convertToBitmapEx(
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index b6bf98314752..128548222f4c 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -111,9 +111,10 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
- aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
- getLocale());
+ std::unique_ptr<gfx::ITextLayouter> pTextLayouter
+ = std::make_unique<drawinglayer::processor2d::TextLayouterDevice>();
+ pTextLayouter->setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
+ getLocale());
// When getting outlines from stretched text (aScale.getX() != 1.0) it
// is necessary to inverse-scale the DXArray (if used) to not get the
@@ -129,14 +130,14 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
}
// get the text outlines
- aTextLayouter.getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
- aScaledDXArray);
+ pTextLayouter->getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
+ aScaledDXArray);
}
else
{
// get the text outlines
- aTextLayouter.getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
- getDXArray());
+ pTextLayouter->getTextOutlines(rTarget, getText(), getTextPosition(), getTextLength(),
+ getDXArray());
}
// create primitives for the outlines
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 5b9adf4c0ab1..919c09cfe430 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -131,7 +131,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index a41037426b09..ffc6c466064f 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -240,7 +240,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process child content recursively
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index cd4593b2a3a9..8a173b21fd01 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -94,7 +94,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index 5eb6c9f9c8ff..bc60998f2d03 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -185,7 +185,7 @@ namespace drawinglayer::processor2d
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aParameters(aViewInformation2D, maVisitingParameters.getTextLayouter());
updateVisitingParameters(aParameters);
// process content
diff --git a/drawinglayer/source/processor2d/textlayoutdevice.cxx b/drawinglayer/source/processor2d/textlayoutdevice.cxx
index 759a5757c8a2..1af699d766ee 100644
--- a/drawinglayer/source/processor2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/processor2d/textlayoutdevice.cxx
@@ -164,6 +164,14 @@ TextLayouterDevice::~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE { releaseGloba
void TextLayouterDevice::setFont(const vcl::Font& rFont) { mrDevice.SetFont(rFont); }
+void TextLayouterDevice::setFontAttribute(const gfx::IFontAttribute& rFontAttribute,
+ double fFontScaleX, double fFontScaleY,
+ const css::lang::Locale& rLocale)
+{
+ auto rFontA = dynamic_cast<attribute::FontAttribute const&>(rFontAttribute);
+ setFontAttribute(rFontA, fFontScaleX, fFontScaleY, rLocale);
+}
+
void TextLayouterDevice::setFontAttribute(const attribute::FontAttribute& rFontAttribute,
double fFontScaleX, double fFontScaleY,
const css::lang::Locale& rLocale)
@@ -342,8 +350,8 @@ std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& rText,
// helper methods for vcl font handling
-vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttribute,
- double fFontScaleX, double fFontScaleY, double fFontRotation,
+vcl::Font getVclFontFromFontAttribute(const gfx::IFontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, double fFontRotation,
const css::lang::Locale& rLocale)
{
// detect FontScaling
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index c75bcb8b7135..3865e64b7347 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2254,7 +2254,8 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ primitive2d::VisitingParameters aVisitingParameters(
+ aViewInfo, maVisitingParameters.getTextLayouter());
VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *aBufferDevice);
@@ -2394,7 +2395,8 @@ void VclMetafileProcessor2D::processPrimitive2DOnPixelProcessor(
auto pBufferDevice(CreateBufferDevice(aViewRange, aViewInfo, aRectLogic, aSizePixel));
if (pBufferDevice)
{
- primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo,
+ maVisitingParameters.getTextLayouter());
VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *pBufferDevice,
maBColorModifierStack);
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 3c611942c623..2c99a6642cfe 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -903,7 +903,8 @@ void VclProcessor2D::RenderTransformPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D,
+ maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process content
@@ -927,7 +928,8 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
rPagePreviewCandidate.getXDrawPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D,
+ maVisitingParameters.getTextLayouter());
updateVisitingParameters(aVisitingParameters);
// process decomposed content
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx b/drawinglayer/source/tools/primitive2dxmldump.cxx
index dd8d54767157..f12bcda5d6ab 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -33,6 +33,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -151,7 +152,8 @@ void Primitive2dXmlDump::decomposeAndWrite(
::tools::XmlWriter& rWriter)
{
drawinglayer::geometry::ViewInformation2D aInfo;
- drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aInfo);
+ auto pTextLayouter = std::make_shared<drawinglayer::processor2d::TextLayouterDevice>();
+ drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aInfo, pTextLayouter);
for (size_t i = 0; i < rPrimitive2DSequence.size(); i++)
{
diff --git a/include/basegfx/text/ITextLayouter.hxx b/include/basegfx/text/ITextLayouter.hxx
new file mode 100644
index 000000000000..26ce4697e275
--- /dev/null
+++ b/include/basegfx/text/ITextLayouter.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <sal/config.h>
+#include <basegfx/basegfxdllapi.h>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+namespace com::sun::star::lang
+{
+struct Locale;
+}
+
+namespace gfx
+{
+class BASEGFX_DLLPUBLIC IFontAttribute
+{
+public:
+ virtual ~IFontAttribute() {}
+
+ virtual const OUString& getFamilyName() const = 0;
+ virtual const OUString& getStyleName() const = 0;
+ virtual sal_uInt16 getWeight() const = 0;
+ virtual bool getSymbol() const = 0;
+ virtual bool getVertical() const = 0;
+ virtual bool getItalic() const = 0;
+ virtual bool getOutline() const = 0;
+ virtual bool getRTL() const = 0;
+ virtual bool getBiDiStrong() const = 0;
+ virtual bool getMonospaced() const = 0;
+};
+
+class BASEGFX_DLLPUBLIC ITextLayouter
+{
+public:
+ virtual ~ITextLayouter() {}
+
+ virtual void setFontAttribute(IFontAttribute const& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale)
+ = 0;
+
+ virtual void getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
+ const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength,
+ const std::vector<double>& rDXArray) const = 0;
+};
+
+} // end namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/text/UnoTextLayouter.hxx b/include/basegfx/text/UnoTextLayouter.hxx
new file mode 100644
index 000000000000..f8b0f250edee
--- /dev/null
+++ b/include/basegfx/text/UnoTextLayouter.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/servicehelper.hxx>
+
+#include <com/sun/star/graphic/XTextLayouter.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+
+#include <basegfx/text/ITextLayouter.hxx>
+#include <basegfx/basegfxdllapi.h>
+
+namespace gfx
+{
+BASEGFX_DLLPUBLIC std::shared_ptr<gfx::ITextLayouter>
+getTextLayouterFromUno(css::uno::Reference<css::graphic::XTextLayouter> const& xTextLayouter);
+
+class UnoTextLayouter final
+ : public cppu::WeakImplHelper<css::graphic::XTextLayouter, css::lang::XUnoTunnel>
+{
+private:
+ std::shared_ptr<gfx::ITextLayouter> mpTextLayouter;
+
+public:
+ UnoTextLayouter() {}
+
+ UnoTextLayouter(std::shared_ptr<gfx::ITextLayouter> const& rTextLayouter)
+ : mpTextLayouter(rTextLayouter)
+ {
+ }
+
+ std::shared_ptr<gfx::ITextLayouter> const& getTextLayouter() const { return mpTextLayouter; }
+
+ void setTextLayouter(std::shared_ptr<gfx::ITextLayouter> const& rTextLayouter)
+ {
+ mpTextLayouter = rTextLayouter;
+ }
+
+ UNO3_GETIMPLEMENTATION_DECL(UnoTextLayouter)
+};
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
index 1a7250170b6e..ed0be642f615 100644
--- a/include/drawinglayer/attribute/fontattribute.hxx
+++ b/include/drawinglayer/attribute/fontattribute.hxx
@@ -23,6 +23,8 @@
#include <o3tl/cow_wrapper.hxx>
#include <rtl/ustring.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
+
namespace drawinglayer::attribute
{
class ImpFontAttribute;
@@ -35,7 +37,7 @@ namespace drawinglayer::attribute
This attribute class is able to hold all parameters needed/used
to completely define the parametrisation of a text portion.
*/
-class DRAWINGLAYER_DLLPUBLIC FontAttribute
+class DRAWINGLAYER_DLLPUBLIC FontAttribute : public gfx::IFontAttribute
{
public:
typedef o3tl::cow_wrapper<ImpFontAttribute> ImplType;
@@ -50,26 +52,26 @@ public:
bool bMonospaced = false, bool bOutline = false, bool bRTL = false,
bool bBiDiStrong = false);
FontAttribute();
- FontAttribute(const FontAttribute&);
- FontAttribute(FontAttribute&&);
- FontAttribute& operator=(const FontAttribute&);
- FontAttribute& operator=(FontAttribute&&);
- ~FontAttribute();
+ FontAttribute(const FontAttribute& rOther);
+ FontAttribute(FontAttribute&& rOther) noexcept;
+ FontAttribute& operator=(const FontAttribute& rOther);
+ FontAttribute& operator=(FontAttribute&& rOther) noexcept;
+ virtual ~FontAttribute();
// compare operator
bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const OUString& getFamilyName() const;
- const OUString& getStyleName() const;
- sal_uInt16 getWeight() const;
- bool getSymbol() const;
- bool getVertical() const;
- bool getItalic() const;
- bool getOutline() const;
- bool getRTL() const;
- bool getBiDiStrong() const;
- bool getMonospaced() const;
+ const OUString& getFamilyName() const override;
+ const OUString& getStyleName() const override;
+ sal_uInt16 getWeight() const override;
+ bool getSymbol() const override;
+ bool getVertical() const override;
+ bool getItalic() const override;
+ bool getOutline() const override;
+ bool getRTL() const override;
+ bool getBiDiStrong() const override;
+ bool getMonospaced() const override;
};
} // end of namespace drawinglayer::attribute
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index d46f42144636..58c93c78dcda 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/util/XAccounting.hpp>
#include <cppuhelper/basemutex.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
/** defines ImplPrimitive2DIDBlock
@@ -44,10 +45,13 @@ class DRAWINGLAYERCORE_DLLPUBLIC VisitingParameters
{
private:
geometry::ViewInformation2D maViewInformation;
+ std::shared_ptr<gfx::ITextLayouter> mpTextLayouter;
public:
- explicit VisitingParameters(const geometry::ViewInformation2D& rViewInformation)
+ explicit VisitingParameters(geometry::ViewInformation2D const& rViewInformation,
+ std::shared_ptr<gfx::ITextLayouter> const& pTextLayouter)
: maViewInformation(rViewInformation)
+ , mpTextLayouter(pTextLayouter)
{
}
@@ -59,6 +63,8 @@ public:
}
const geometry::ViewInformation2D& getViewInformation() const { return maViewInformation; }
+
+ const std::shared_ptr<gfx::ITextLayouter>& getTextLayouter() const { return mpTextLayouter; }
};
typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAccounting>
diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx
index 802434fd9009..c723c5c0c619 100644
--- a/include/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -24,7 +24,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
-
+#include <basegfx/text/ITextLayouter.hxx>
namespace drawinglayer::processor2d
{
diff --git a/include/drawinglayer/processor2d/textlayoutdevice.hxx b/include/drawinglayer/processor2d/textlayoutdevice.hxx
index ddcdf06bc0dd..edcefec190e1 100644
--- a/include/drawinglayer/processor2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/processor2d/textlayoutdevice.hxx
@@ -25,6 +25,7 @@
#include <vector>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <vcl/svapp.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
// predefines
class VirtualDevice;
@@ -58,7 +59,7 @@ namespace drawinglayer::processor2d
When in the future FontHandling may move to an own library independent
from VCL, primitives will be prepared.
*/
-class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
+class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice : public gfx::ITextLayouter
{
/// internally used VirtualDevice
SolarMutexGuard maSolarGuard;
@@ -71,6 +72,10 @@ public:
/// tooling methods
void setFont(const vcl::Font& rFont);
+
+ void setFontAttribute(const gfx::IFontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale) override;
+
void setFontAttribute(const attribute::FontAttribute& rFontAttribute, double fFontScaleX,
double fFontScaleY, const css::lang::Locale& rLocale);
@@ -84,7 +89,7 @@ public:
double getTextWidth(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength) const;
void getTextOutlines(basegfx::B2DPolyPolygonVector&, const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const;
+ sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const override;
basegfx::B2DRange getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
sal_uInt32 nLength) const;
@@ -111,7 +116,7 @@ public:
fFontScaleY == fFontScaleX
*/
vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
- const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
+ const gfx::IFontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
double fFontRotation, const css::lang::Locale& rLocale);
/** Generate FontAttribute DataSet derived from the given VCL-Font.
diff --git a/offapi/com/sun/star/graphic/XTextLayouter.idl b/offapi/com/sun/star/graphic/XTextLayouter.idl
new file mode 100644
index 000000000000..c518558d49cf
--- /dev/null
+++ b/offapi/com/sun/star/graphic/XTextLayouter.idl
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef com_sun_star_graphic_XTextLayouter_idl
+#define com_sun_star_graphic_XTextLayouter_idl
+
+#include <com/sun/star/uno/XInterface.idl>
+
+module com { module sun { module star { module graphic
+{
+
+/** Text layouter interface
+*/
+
+interface XTextLayouter : ::com::sun::star::uno::XInterface
+{
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3ba206b99ca6fb491142eb97cd723d10bc55993b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Fri Feb 19 17:37:22 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Feb 23 14:53:09 2021 +0900
drawinglayer: move TextLayouter to processor2d
Change-Id: I87c7fafb51f108dcf58e7ddb97595f6488d884a0
diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 451a9b1e55d3..05f47793daae 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -95,7 +95,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/primitive2d/textdecoratedprimitive2d \
drawinglayer/source/primitive2d/texteffectprimitive2d \
drawinglayer/source/primitive2d/texthierarchyprimitive2d \
- drawinglayer/source/primitive2d/textlayoutdevice \
drawinglayer/source/primitive2d/textlineprimitive2d \
drawinglayer/source/primitive2d/textprimitive2d \
drawinglayer/source/primitive2d/textstrikeoutprimitive2d \
@@ -130,6 +129,7 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/processor2d/objectinfoextractor2d \
drawinglayer/source/processor2d/processorfromoutputdevice \
drawinglayer/source/processor2d/textaspolygonextractor2d \
+ drawinglayer/source/processor2d/textlayoutdevice \
drawinglayer/source/processor2d/vclhelperbufferdevice \
drawinglayer/source/processor2d/vclmetafileprocessor2d \
drawinglayer/source/processor2d/vclpixelprocessor2d \
diff --git a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
index 8befcff3a7e3..43db89f68dd0 100644
--- a/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx
@@ -59,7 +59,7 @@ namespace drawinglayer::primitive2d
return;
// common preparations
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
// TextLayouterDevice is needed to get metrics for text decorations like
// underline/strikeout/emphasis marks from it. For setup, the font size is needed
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index aa95f0091c30..b6bf98314752 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -18,7 +18,7 @@
*/
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
@@ -111,7 +111,7 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation(
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
getLocale());
@@ -271,7 +271,7 @@ TextSimplePortionPrimitive2D::getB2DRange(VisitingParameters const& /*rParameter
const basegfx::B2DVector aFontScale(getCorrectedScaleAndFontScale(aScale));
// prepare textlayoutdevice
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(getFontAttribute(), aFontScale.getX(), aFontScale.getY(),
getLocale());
diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
index 71818e7861cc..25f4e0a1fa8d 100644
--- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx
@@ -18,7 +18,7 @@
*/
#include <primitive2d/textstrikeoutprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
getObjectTransformation().decompose(aScale, aTranslate, fRotate, fShearX);
// prepare TextLayouter
- TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFontAttribute(
getFontAttribute(),
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/processor2d/textlayoutdevice.cxx
similarity index 99%
rename from drawinglayer/source/primitive2d/textlayoutdevice.cxx
rename to drawinglayer/source/processor2d/textlayoutdevice.cxx
index 933476b2045a..759a5757c8a2 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/processor2d/textlayoutdevice.cxx
@@ -23,7 +23,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <drawinglayer/attribute/fontattribute.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/unique_disposing_ptr.hxx>
#include <osl/diagnose.h>
@@ -36,7 +36,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/svapp.hxx>
-namespace drawinglayer::primitive2d
+namespace drawinglayer::processor2d
{
namespace
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index c468da266430..3c611942c623 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -52,7 +52,7 @@
// for support of Title/Description in all apps when embedding pictures
#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
// control support
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
@@ -124,7 +124,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
&& basegfx::fTools::more(aFontScaling.getY(), 0.0))
{
// Get the VCL font (use FontHeight as FontWidth)
- vcl::Font aFont(primitive2d::getVclFontFromFontAttribute(
+ vcl::Font aFont(processor2d::getVclFontFromFontAttribute(
rTextCandidate.getFontAttribute(), aFontScaling.getX(), aFontScaling.getY(),
fRotate, rTextCandidate.getLocale()));
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index a4bfa3d36c46..c75516bd050c 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -39,7 +39,7 @@
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <primitive2d/wallpaperprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
#include <primitive2d/textlineprimitive2d.hxx>
#include <primitive2d/textstrikeoutprimitive2d.hxx>
@@ -1067,7 +1067,7 @@ namespace wmfemfhelper
const vcl::Font& rFont = rProperty.getFont();
basegfx::B2DVector aFontScaling;
- rFontAttribute = drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ rFontAttribute = drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
rFont,
bool(rProperty.getLayoutMode() & ComplexTextLayoutFlags::BiDiRtl),
@@ -1079,7 +1079,7 @@ namespace wmfemfhelper
// take text align into account
if(ALIGN_BASELINE != rFont.GetAlignment())
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rFont);
if(ALIGN_TOP == rFont.GetAlignment())
@@ -1231,7 +1231,7 @@ namespace wmfemfhelper
if(pResult && rProperty.getTextFillColorActive())
{
// text background is requested, add and encapsulate both to new primitive
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rFont);
// get text width
@@ -1341,7 +1341,7 @@ namespace wmfemfhelper
aTextTransform.translate(rAction.GetStartPoint().X(), rAction.GetStartPoint().Y());
// prepare TextLayouter (used in most cases)
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(rProperty.getFont());
if(bOverlineUsed)
@@ -1885,7 +1885,7 @@ namespace wmfemfhelper
if(nTextLength && rPropertyHolders.Current().getTextColorActive())
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
std::vector< double > aTextArray(
@@ -1947,7 +1947,7 @@ namespace wmfemfhelper
// Since AddTextRectActions is the only way as long as we do not have
// a simple text layouter available, i will try to add it to the
// TextLayouterDevice isolation.
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
GDIMetaFile aGDIMetaFile;
diff --git a/include/drawinglayer/primitive2d/textbreakuphelper.hxx b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
index de233da8ea07..afe15f45f711 100644
--- a/include/drawinglayer/primitive2d/textbreakuphelper.hxx
+++ b/include/drawinglayer/primitive2d/textbreakuphelper.hxx
@@ -21,7 +21,7 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace drawinglayer::primitive2d { class TextSimplePortionPrimitive2D; }
@@ -40,7 +40,7 @@ namespace drawinglayer::primitive2d
private:
const TextSimplePortionPrimitive2D& mrSource;
Primitive2DContainer mxResult;
- TextLayouterDevice maTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice maTextLayouter;
basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose maDecTrans;
bool mbNoDXArray : 1;
@@ -58,7 +58,7 @@ namespace drawinglayer::primitive2d
virtual bool allowChange(sal_uInt32 nCount, basegfx::B2DHomMatrix& rNewTransform, sal_uInt32 nIndex, sal_uInt32 nLength);
/// allow read access to evtl. useful local parts
- const TextLayouterDevice& getTextLayouter() const { return maTextLayouter; }
+ const drawinglayer::processor2d::TextLayouterDevice& getTextLayouter() const { return maTextLayouter; }
const TextSimplePortionPrimitive2D& getSource() const { return mrSource; }
public:
diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/processor2d/textlayoutdevice.hxx
similarity index 98%
rename from include/drawinglayer/primitive2d/textlayoutdevice.hxx
rename to include/drawinglayer/processor2d/textlayoutdevice.hxx
index 93587769c449..ddcdf06bc0dd 100644
--- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/processor2d/textlayoutdevice.hxx
@@ -49,7 +49,7 @@ struct Locale;
// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive
-namespace drawinglayer::primitive2d
+namespace drawinglayer::processor2d
{
/** TextLayouterDevice class
@@ -122,6 +122,6 @@ vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
attribute::FontAttribute DRAWINGLAYER_DLLPUBLIC getFontAttributeFromVclFont(
basegfx::B2DVector& o_rSize, const vcl::Font& rFont, bool bRTL, bool bBiDiStrong);
-} // end of namespace drawinglayer::primitive2d
+} // end of namespace drawinglayer::processor2d
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index 52df55eb933e..fc1c569aebfb 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -23,7 +23,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -65,7 +65,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
// Create the text primitive for the title
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr =
- drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, aHeadFont, false, false);
+ drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, aHeadFont, false, false);
FontMetric aFontMetric = pDefaultDev->GetFontMetric(aHeadFont);
Size aHintMargin = pDefaultDev->PixelToLogic(Size(HINT_MARGIN, HINT_MARGIN), rMapMode);
@@ -101,7 +101,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
nTextOffsetY = aFontMetric.GetAscent();
sal_Int32 nLineHeight = aFontMetric.GetLineHeight();
- aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, aTextFont, false, false);
+ aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, aTextFont, false, false);
sal_Int32 nIndex = 0;
Point aLineStart = aTextStart;
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 5a2a0be72ce7..620bf88f6db6 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -67,7 +67,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/table/tablecontroller.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -360,7 +360,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor );
// get basic geometry and get text size
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(aScaledVclFont);
const sal_Int32 nTextLength(aObjectString.getLength());
@@ -384,7 +384,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
aVclFont.SetFontHeight( 500 );
const drawinglayer::attribute::FontAttribute aFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aTextSizeAttribute,
aVclFont,
false,
diff --git a/sfx2/source/control/emojiviewitem.cxx b/sfx2/source/control/emojiviewitem.cxx
index f9394ea9435c..5878aef883fd 100644
--- a/sfx2/source/control/emojiviewitem.cxx
+++ b/sfx2/source/control/emojiviewitem.cxx
@@ -11,7 +11,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <rtl/ustrbuf.hxx>
@@ -36,7 +36,7 @@ void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight
const tools::Long /*nPadding*/, sal_uInt32 nMaxTextLength,
const ThumbnailItemAttributes *pAttrs)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
css::lang::Locale() );
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index efd0ffbf2f7e..cd36e2e4f1eb 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -18,7 +18,7 @@
#include <comphelper/processfactory.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <o3tl/safeint.hxx>
@@ -894,7 +894,7 @@ void ThumbnailView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
OutputDevice& rDevice = pDrawingArea->get_ref_device();
pDefaultDevice->SetPointFont(rDevice, pDrawingArea->get_font());
- mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize, rDevice.GetFont(), false, true);
+ mpItemAttrs->aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(mpItemAttrs->aFontSize, rDevice.GetFont(), false, true);
}
SetOutputSizePixel(pDrawingArea->get_preferred_size());
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 79a71c361c9b..e8cc2945b3e6 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -27,7 +27,7 @@
#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <vcl/graph.hxx>
@@ -120,7 +120,7 @@ void ThumbnailViewItem::calculateItemsPosition (const tools::Long nThumbnailHeig
const tools::Long nPadding, sal_uInt32 nMaxTextLength,
const ThumbnailItemAttributes *pAttrs)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
css::lang::Locale() );
@@ -205,7 +205,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const ThumbnailItemAttributes *pAttrs, Point aPos, drawinglayer::primitive2d::Primitive2DContainer& rSeq)
{
// adjust text drawing position according to text font
- drawinglayer::primitive2d::TextLayouterDevice aTextDev;
+ drawinglayer::processor2d::TextLayouterDevice aTextDev;
aTextDev.setFontAttribute(
pAttrs->aFontAttr,
pAttrs->aFontSize.getX(),
@@ -218,7 +218,7 @@ void ThumbnailViewItem::addTextPrimitives (const OUString& rText, const Thumbnai
OUString aOrigText(mrParent.isDrawMnemonic() ? OutputDevice::GetNonMnemonicString(rText, nMnemonicPos) : rText);
TextEngine aTextEngine;
- aTextEngine.SetFont(getVclFontFromFontAttribute(pAttrs->aFontAttr,
+ aTextEngine.SetFont(drawinglayer::processor2d::getVclFontFromFontAttribute(pAttrs->aFontAttr,
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(), 0,
css::lang::Locale()));
aTextEngine.SetMaxTextWidth(maDrawArea.getWidth());
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index dc24adc7ffc0..95a21d14e651 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -21,7 +21,7 @@
#include <svgstyleattributes.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textbreakuphelper.hxx>
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
@@ -258,7 +258,7 @@ namespace svgio::svgreader
css::lang::Locale aLocale;
// prepare TextLayouterDevice
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFontAttribute(aFontAttribute, fFontWidth, fFontHeight, aLocale);
// prepare TextArray
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index fd53bf0e9d3d..7734c769c4c1 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -51,7 +51,7 @@
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -162,7 +162,7 @@ namespace
OUString caseMappedText = rInfo.mrFont.CalcCaseMap( rInfo.maText );
basegfx::B2DVector aFontScaling;
drawinglayer::attribute::FontAttribute aFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
rInfo.mrFont,
rInfo.IsRTL(),
@@ -592,7 +592,7 @@ namespace
}
// Start position is inside. Get TextBoundRect and TopLeft next
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouterDevice;
aTextLayouterDevice.setFont(pInfo->mrFont);
const basegfx::B2DRange aTextBoundRect(
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index a607d05c7800..81c25f9b3c6f 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -31,7 +31,7 @@
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
@@ -130,7 +130,7 @@ namespace
double getDisplayLength(sal_Int32 nIndex, sal_Int32 nLength) const
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
if(maFont.IsVertical())
@@ -201,7 +201,7 @@ namespace
static double getParagraphTextLength(const ::std::vector< const impPathTextPortion* >& rTextPortions)
{
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
for(const impPathTextPortion* pCandidate : rTextPortions)
@@ -328,13 +328,13 @@ namespace
if(pCandidate && pCandidate->getTextLength())
{
const drawinglayer::attribute::FontAttribute aCandidateFontAttribute(
- drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontScaling,
pCandidate->getFont(),
pCandidate->isRTL(),
false));
- drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
+ drawinglayer::processor2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(pCandidate->getFont());
sal_Int32 nUsedTextLength(0);
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6d47b824118c..0178073e48f4 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -92,7 +92,7 @@
#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <svx/unoapi.hxx>
@@ -3665,7 +3665,7 @@ void SwColumnFrame::PaintBreak( ) const
vcl::Font aFont = pOut->GetSettings().GetStyleSettings().GetToolFont();
aFont.SetFontHeight( 8 * 20 );
pOut->SetFont( aFont );
- drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(
aFontSize, aFont, IsRightToLeft(), false );
tools::Rectangle aTextRect;
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index d1ea5471649c..fea1ea9533bb 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -35,8 +35,8 @@
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <editeng/boxitem.hxx>
#include <svx/hdft.hxx>
#include <sfx2/bindings.hxx>
@@ -309,7 +309,7 @@ void SwHeaderFooterWin::PaintButton()
// Create the text primitive
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
B2DVector aFontSize;
- FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(), false, false);
+ FontAttribute aFontAttr = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(), false, false);
FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx
index bfe76c8cb690..af4eb7b26863 100644
--- a/sw/source/uibase/docvw/UnfloatTableButton.cxx
+++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx
@@ -34,7 +34,7 @@
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/attribute/fontattribute.hxx>
-#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/processor2d/textlayoutdevice.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -208,7 +208,7 @@ void UnfloatTableButton::PaintButton()
basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
basegfx::B2DVector aFontSize;
drawinglayer::attribute::FontAttribute aFontAttr
- = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(),
+ = drawinglayer::processor2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(),
false, false);
FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
commit f36ff2a9de53ee59305c3299e2bc2ea0dd461d3c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 23 13:23:32 2021 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Feb 23 13:23:32 2021 +0900
drawinglayer: make VisitingParameters constructor explicit
This discovers a bunch of cases where previously the
ViewInformation was implicitly converted into a VisitingParameter.
Change-Id: Ice233e9d3c9d12c5da284e190281a1d94059f49f
diff --git a/drawinglayer/inc/converters.hxx b/drawinglayer/inc/converters.hxx
index 5e4e8a49bdb5..8093c10db896 100644
--- a/drawinglayer/inc/converters.hxx
+++ b/drawinglayer/inc/converters.hxx
@@ -26,7 +26,7 @@ namespace drawinglayer
{
BitmapEx convertToBitmapEx(
const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
- const geometry::ViewInformation2D& rViewInformation2D,
+ drawinglayer::primitive2d::VisitingParameters const& rParameters,
sal_uInt32 nDiscreteWidth,
sal_uInt32 nDiscreteHeight,
sal_uInt32 nMaxSquarePixels);
diff --git a/drawinglayer/qa/unit/border.cxx b/drawinglayer/qa/unit/border.cxx
index 8c4e6e08419b..1d595b8103e7 100644
--- a/drawinglayer/qa/unit/border.cxx
+++ b/drawinglayer/qa/unit/border.cxx
@@ -66,9 +66,10 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, testDoubleDecompositionSolid)
aStrokeAttribute));
// Decompose it into polygons.
- drawinglayer::geometry::ViewInformation2D aView;
+ const drawinglayer::geometry::ViewInformation2D aView;
+ const drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aView);
drawinglayer::primitive2d::Primitive2DContainer aContainer;
- aBorder->get2DDecomposition(aContainer, aView);
+ aBorder->get2DDecomposition(aContainer, aVisitingParameters);
// Make sure it results in two borders as it's a double one.
CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), aContainer.size());
@@ -91,8 +92,9 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, testDoublePixelProcessing)
// Create a pixel processor.
ScopedVclPtrInstance<VirtualDevice> pDev;
drawinglayer::geometry::ViewInformation2D aView;
- std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
- drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(*pDev, aView));
+ const drawinglayer::primitive2d::VisitingParameters aVisitingParameters(aView);
+ auto pProcessor = drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
+ *pDev, aVisitingParameters);
CPPUNIT_ASSERT(pProcessor);
GDIMetaFile aMetaFile;
// Start recording after the processor is created, so we can test the pixel processor.
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 66b29591df7e..37fa2a2a477f 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -107,6 +107,8 @@ namespace drawinglayer::unorenderer
}
const geometry::ViewInformation2D aViewInformation2D(aViewInformationSequence);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+
const double fFactor100th_mmToInch(1.0 / (2.54 * 1000.0));
const sal_uInt32 nDiscreteWidth(basegfx::fround((fWidth * fFactor100th_mmToInch) * DPI_X));
const sal_uInt32 nDiscreteHeight(basegfx::fround((fHeight * fFactor100th_mmToInch) * DPI_Y));
@@ -129,7 +131,7 @@ namespace drawinglayer::unorenderer
BitmapEx aBitmapEx(
convertToBitmapEx(
xEmbedSeq,
- aViewInformation2D,
+ aVisitingParameters,
nDiscreteWidth,
nDiscreteHeight,
MaximumQuadraticPixels));
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 91cfdaf1861d..10c893d21a1b 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -100,17 +100,19 @@ namespace drawinglayer::primitive2d
// see if buffering is wanted. If so, create buffered content in given resolution
if(0 != mnDiscreteWidth && 0 != mnDiscreteHeight)
{
- const geometry::ViewInformation2D aViewInformation2D;
const primitive2d::Primitive2DReference xEmbedRef(
new primitive2d::TransformPrimitive2D(
basegfx::utils::createScaleB2DHomMatrix(mnDiscreteWidth, mnDiscreteHeight),
getChildren()));
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
+ const geometry::ViewInformation2D aViewInformation2D;
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+
const BitmapEx aBitmapEx(
convertToBitmapEx(
xEmbedSeq,
- aViewInformation2D,
+ aVisitingParameters,
mnDiscreteWidth,
mnDiscreteHeight,
mnDiscreteWidth * mnDiscreteHeight));
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
index 0e6d2f5b8e96..f499e026dcc8 100644
--- a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
@@ -84,7 +84,7 @@ namespace drawinglayer::primitive2d
// I will take the last one here. The small overhead of two primitives will only be
// used when UnifiedTransparencePrimitive2D is not handled directly.
- const basegfx::B2DRange aPolygonRange(getChildren().getB2DRange(rParameters.getViewInformation()));
+ const basegfx::B2DRange aPolygonRange(getChildren().getB2DRange(rParameters));
const basegfx::B2DPolygon aPolygon(basegfx::utils::createPolygonFromRect(aPolygonRange));
const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
Primitive2DContainer aTransparenceContent(2);
diff --git a/drawinglayer/source/processor2d/baseprocessor2d.cxx b/drawinglayer/source/processor2d/baseprocessor2d.cxx
index 9d1671dcf959..39b72feec77f 100644
--- a/drawinglayer/source/processor2d/baseprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/baseprocessor2d.cxx
@@ -30,8 +30,8 @@ namespace drawinglayer::processor2d
{
}
- BaseProcessor2D::BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation)
- : maViewInformation2D(rViewInformation)
+ BaseProcessor2D::BaseProcessor2D(primitive2d::VisitingParameters const & rVisitingParameters)
+ : maVisitingParameters(rVisitingParameters)
{
}
@@ -42,7 +42,7 @@ namespace drawinglayer::processor2d
void BaseProcessor2D::process(const primitive2d::BasePrimitive2D& rCandidate)
{
primitive2d::Primitive2DContainer aContainer;
- rCandidate.get2DDecomposition(aContainer, getViewInformation2D());
+ rCandidate.get2DDecomposition(aContainer, maVisitingParameters);
process(aContainer);
}
@@ -71,7 +71,7 @@ namespace drawinglayer::processor2d
else
{
// unknown implementation, use UNO API call instead and process recursively
- const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation2D().getViewInformationSequence());
+ const uno::Sequence<beans::PropertyValue>& rViewParameters(maVisitingParameters.getUnoProperties());
process(comphelper::sequenceToContainer<primitive2d::Primitive2DContainer>(xReference->getDecomposition(rViewParameters)));
}
}
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 8abec2f50f9d..5b9adf4c0ab1 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -36,9 +36,9 @@ using namespace com::sun::star;
namespace drawinglayer::processor2d
{
ContourExtractor2D::ContourExtractor2D(
- const geometry::ViewInformation2D& rViewInformation,
+ primitive2d::VisitingParameters const& rVisitingParameters,
bool bExtractFillOnly)
- : BaseProcessor2D(rViewInformation),
+ : BaseProcessor2D(rVisitingParameters),
maExtractedContour(),
mbExtractFillOnly(bExtractFillOnly)
{
@@ -121,7 +121,7 @@ namespace drawinglayer::processor2d
{
// remember current ViewInformation2D
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -131,13 +131,14 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
@@ -173,7 +174,7 @@ namespace drawinglayer::processor2d
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// primitives who's BoundRect will be added in world coordinates
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if (!aRange.isEmpty())
{
aRange.transform(getViewInformation2D().getObjectTransformation());
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 04505489c6f2..a41037426b09 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -37,11 +37,11 @@
namespace drawinglayer::processor2d
{
- HitTestProcessor2D::HitTestProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+ HitTestProcessor2D::HitTestProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
const basegfx::B2DPoint& rLogicHitPosition,
double fLogicHitTolerance,
bool bHitTextOnly)
- : BaseProcessor2D(rViewInformation),
+ : BaseProcessor2D(rVisitingParameters),
maDiscreteHitPosition(),
mfDiscreteHitTolerance(0.0),
maHitStack(),
@@ -230,7 +230,7 @@ namespace drawinglayer::processor2d
{
// remember current ViewInformation2D
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D containing transformation
const geometry::ViewInformation2D aViewInformation2D(
@@ -240,13 +240,14 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process child content recursively
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
@@ -411,7 +412,7 @@ namespace drawinglayer::processor2d
case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
{
// for text use the BoundRect of the primitive itself
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
@@ -428,7 +429,7 @@ namespace drawinglayer::processor2d
// The recently added BitmapEx::GetTransparency() makes it easy to extend
// the BitmapPrimitive2D HitTest to take the contained BitmapEx and it's
// transparency into account
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
@@ -482,7 +483,7 @@ namespace drawinglayer::processor2d
// This may be refined in the future, e.g:
// - For Bitmaps, the mask and/or transparence information may be used
// - For MetaFiles, the MetaFile content may be used
- const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
if(!aRange.isEmpty())
{
diff --git a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
index 9262e23e4509..cd4593b2a3a9 100644
--- a/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
+++ b/drawinglayer/source/processor2d/linegeometryextractor2d.cxx
@@ -29,8 +29,8 @@ using namespace com::sun::star;
namespace drawinglayer::processor2d
{
- LineGeometryExtractor2D::LineGeometryExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ LineGeometryExtractor2D::LineGeometryExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
maExtractedHairlines(),
maExtractedLineFills(),
mbInLineGeometry(false)
@@ -83,7 +83,7 @@ namespace drawinglayer::processor2d
{
// remember current transformation and ViewInformation
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new transformations for CurrentTransformation and for local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -93,13 +93,15 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
break;
}
diff --git a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
index 552406d53f68..4d3eb0188c14 100644
--- a/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
+++ b/drawinglayer/source/processor2d/objectinfoextractor2d.cxx
@@ -62,8 +62,8 @@ namespace drawinglayer::processor2d
}
}
- ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
mpFound(nullptr)
{
}
diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx b/drawinglayer/source/processor2d/processor2dtools.cxx
index 7bc0f5fa0536..921ec4af81c3 100644
--- a/drawinglayer/source/processor2d/processor2dtools.cxx
+++ b/drawinglayer/source/processor2d/processor2dtools.cxx
@@ -29,15 +29,15 @@ namespace drawinglayer::processor2d
{
std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ const drawinglayer::primitive2d::VisitingParameters& rParameters)
{
// create Pixel Vcl-Processor
- return std::make_unique<VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<VclPixelProcessor2D>(rParameters, rTargetOutDev);
}
std::unique_ptr<BaseProcessor2D> createProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ const drawinglayer::primitive2d::VisitingParameters& rParameters)
{
const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
@@ -45,14 +45,12 @@ namespace drawinglayer::processor2d
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return std::make_unique<VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<VclMetafileProcessor2D>(rParameters, rTargetOutDev);
}
else
{
// create Pixel Vcl-Processor
- return createPixelProcessor2DFromOutputDevice(
- rTargetOutDev,
- rViewInformation2D);
+ return createPixelProcessor2DFromOutputDevice(rTargetOutDev, rParameters);
}
}
diff --git a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
index c8433753aeff..f16ad46faadb 100644
--- a/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
+++ b/drawinglayer/source/processor2d/processorfromoutputdevice.cxx
@@ -29,7 +29,7 @@ namespace drawinglayer::processor2d
{
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> createBaseProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
- const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
+ drawinglayer::primitive2d::VisitingParameters const& rParameters)
{
const GDIMetaFile* pMetaFile = rTargetOutDev.GetConnectMetaFile();
const bool bOutputToRecordingMetaFile(pMetaFile && pMetaFile->IsRecord() && !pMetaFile->IsPause());
@@ -37,12 +37,12 @@ namespace drawinglayer::processor2d
if(bOutputToRecordingMetaFile)
{
// create MetaFile Vcl-Processor and process
- return std::make_unique<drawinglayer::processor2d::VclMetafileProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<drawinglayer::processor2d::VclMetafileProcessor2D>(rParameters, rTargetOutDev);
}
else
{
// create Pixel Vcl-Processor
- return std::make_unique<drawinglayer::processor2d::VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
+ return std::make_unique<drawinglayer::processor2d::VclPixelProcessor2D>(rParameters, rTargetOutDev);
}
}
} // end of namespace
diff --git a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
index e3a584f86172..5eb6c9f9c8ff 100644
--- a/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
+++ b/drawinglayer/source/processor2d/textaspolygonextractor2d.cxx
@@ -174,7 +174,7 @@ namespace drawinglayer::processor2d
{
// remember current transformation and ViewInformation
const primitive2d::TransformPrimitive2D& rTransformCandidate(static_cast< const primitive2d::TransformPrimitive2D& >(rCandidate));
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastParameters(maVisitingParameters);
// create new transformations for CurrentTransformation and for local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -184,13 +184,15 @@ namespace drawinglayer::processor2d
getViewInformation2D().getVisualizedPage(),
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+
+ primitive2d::VisitingParameters aParameters(aViewInformation2D);
+ updateVisitingParameters(aParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastParameters);
break;
}
@@ -216,8 +218,8 @@ namespace drawinglayer::processor2d
}
}
- TextAsPolygonExtractor2D::TextAsPolygonExtractor2D(const geometry::ViewInformation2D& rViewInformation)
- : BaseProcessor2D(rViewInformation),
+ TextAsPolygonExtractor2D::TextAsPolygonExtractor2D(primitive2d::VisitingParameters const& rVisitingParameters)
+ : BaseProcessor2D(rVisitingParameters),
maTarget(),
maBColorModifierStack(),
mnInText(0)
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 7cf4fc4b2cd2..c75bcb8b7135 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -214,7 +214,7 @@ VclMetafileProcessor2D::impDumpToMetaFile(const primitive2d::Primitive2DContaine
// Prepare VDev, MetaFile and connections
OutputDevice* pLastOutputDevice = mpOutputDevice;
GDIMetaFile* pLastMetafile = mpMetaFile;
- basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aPrimitiveRange(rContent.getB2DRange(maVisitingParameters));
// transform primitive range with current transformation (e.g shadow offset)
aPrimitiveRange.transform(maCurrentTransformation);
@@ -547,9 +547,9 @@ void VclMetafileProcessor2D::popList()
// init static break iterator
uno::Reference<css::i18n::XBreakIterator> VclMetafileProcessor2D::mxBreakIterator;
-VclMetafileProcessor2D::VclMetafileProcessor2D(const geometry::ViewInformation2D& rViewInformation,
- OutputDevice& rOutDev)
- : VclProcessor2D(rViewInformation, rOutDev)
+VclMetafileProcessor2D::VclMetafileProcessor2D(
+ drawinglayer::primitive2d::VisitingParameters const& rParameters, OutputDevice& rOutDev)
+ : VclProcessor2D(rParameters, rOutDev)
, mpMetaFile(rOutDev.GetConnectMetaFile())
, mnSvtGraphicFillCount(0)
, mnSvtGraphicStrokeCount(0)
@@ -563,7 +563,7 @@ VclMetafileProcessor2D::VclMetafileProcessor2D(const geometry::ViewInformation2D
"VclMetafileProcessor2D: Used on OutDev which has no MetaFile Target (!)");
// draw to logic coordinates, do not initialize maCurrentTransformation to viewTransformation
// but only to ObjectTransformation. Do not change MapMode of destination.
- maCurrentTransformation = rViewInformation.getObjectTransformation();
+ maCurrentTransformation = rParameters.getViewInformation().getObjectTransformation();
}
VclMetafileProcessor2D::~VclMetafileProcessor2D()
@@ -1122,7 +1122,7 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
{
// still need to fill in the location (is a class Rectangle)
const basegfx::B2DRange aRangeLogic(
- rControlPrimitive.getB2DRange(getViewInformation2D()));
+ rControlPrimitive.getB2DRange(maVisitingParameters));
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aRangeLogic.getMinX())),
static_cast<sal_Int32>(floor(aRangeLogic.getMinY())),
static_cast<sal_Int32>(ceil(aRangeLogic.getMaxX())),
@@ -1233,7 +1233,7 @@ void VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(
// process recursively
primitive2d::Primitive2DContainer rContent;
- rFieldPrimitive.get2DDecomposition(rContent, getViewInformation2D());
+ rFieldPrimitive.get2DDecomposition(rContent, maVisitingParameters);
process(rContent);
// for the end comment the type is not relevant yet, they are all the same. Just add.
@@ -1244,7 +1244,7 @@ void VclMetafileProcessor2D::processTextHierarchyFieldPrimitive2D(
return;
// emulate data handling from ImpEditEngine::Paint
- const basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+ const basegfx::B2DRange aViewRange(rContent.getB2DRange(maVisitingParameters));
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aViewRange.getMinX())),
static_cast<sal_Int32>(floor(aViewRange.getMinY())),
static_cast<sal_Int32>(ceil(aViewRange.getMaxX())),
@@ -2194,7 +2194,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// transparence primitives with non-trivial transparence content) i will for now not
// refine to tiling here.
- basegfx::B2DRange aViewRange(rContent.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aViewRange(rContent.getB2DRange(maVisitingParameters));
aViewRange.transform(maCurrentTransformation);
const tools::Rectangle aRectLogic(static_cast<sal_Int32>(floor(aViewRange.getMinX())),
static_cast<sal_Int32>(floor(aViewRange.getMinY())),
@@ -2254,7 +2254,9 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+
+ VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *aBufferDevice);
// draw content using pixel renderer
const Point aEmptyPoint;
@@ -2385,14 +2387,16 @@ VclMetafileProcessor2D::CreateBufferDevice(const basegfx::B2DRange& rCandidateRa
void VclMetafileProcessor2D::processPrimitive2DOnPixelProcessor(
const primitive2d::BasePrimitive2D& rCandidate)
{
- basegfx::B2DRange aViewRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aViewRange(rCandidate.getB2DRange(maVisitingParameters));
geometry::ViewInformation2D aViewInfo;
tools::Rectangle aRectLogic;
Size aSizePixel;
auto pBufferDevice(CreateBufferDevice(aViewRange, aViewInfo, aRectLogic, aSizePixel));
if (pBufferDevice)
{
- VclPixelProcessor2D aBufferProcessor(aViewInfo, *pBufferDevice, maBColorModifierStack);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInfo);
+ VclPixelProcessor2D aBufferProcessor(aVisitingParameters, *pBufferDevice,
+ maBColorModifierStack);
// draw content using pixel renderer
primitive2d::Primitive2DReference aRef(
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index 67a79ca307cc..4e3f812f3a06 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -203,7 +203,7 @@ protected:
public:
/// constructor/destructor
- VclMetafileProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+ VclMetafileProcessor2D(drawinglayer::primitive2d::VisitingParameters const& rParameters,
OutputDevice& rOutDev);
virtual ~VclMetafileProcessor2D() override;
};
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 143c9351a06a..b74510f5d7be 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -77,14 +77,15 @@ struct VclPixelProcessor2D::Impl
}
};
-VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation,
+VclPixelProcessor2D::VclPixelProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
OutputDevice& rOutDev,
const basegfx::BColorModifierStack& rInitStack)
- : VclProcessor2D(rViewInformation, rOutDev, rInitStack)
+ : VclProcessor2D(rVisitingParameters, rOutDev, rInitStack)
, m_pImpl(new Impl(rOutDev))
{
// prepare maCurrentTransformation matrix with viewTransformation to target directly to pixels
- maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
+ maCurrentTransformation
+ = rVisitingParameters.getViewInformation().getObjectToViewTransformation();
// prepare output directly to pixels
mpOutputDevice->Push(PushFlags::MAPMODE);
@@ -1023,7 +1024,7 @@ AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rMask, double fErodeDilateRadius
void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitive2D& rCandidate)
{
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aGlowRadiusVector(rCandidate.getGlowRadius(), 0);
// Calculate the pixel size of glow radius in current transformation
@@ -1091,7 +1092,7 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D(
// borders, where they don't end. Ideally, process the full object once at maximal reasonable
// resolution, and store the resulting alpha mask in primitive's cache; then reuse it later,
// applying the transform.
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aRadiusVector(rCandidate.getRadius(), 0);
// Calculate the pixel size of soft edge radius in current transformation
@@ -1151,7 +1152,7 @@ void VclPixelProcessor2D::processShadowPrimitive2D(const primitive2d::ShadowPrim
return;
}
- basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rCandidate.getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
basegfx::B2DVector aBlurRadiusVector(rCandidate.getShadowBlur(), 0);
aBlurRadiusVector *= maCurrentTransformation;
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index 480fdcaa6e18..6a1b23db61fe 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -104,7 +104,8 @@ class VclPixelProcessor2D final : public VclProcessor2D
public:
/// constructor/destructor
- VclPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation, OutputDevice& rOutDev,
+ VclPixelProcessor2D(primitive2d::VisitingParameters const& rVisitingParameters,
+ OutputDevice& rOutDev,
const basegfx::BColorModifierStack& rInitStack
= basegfx::BColorModifierStack());
virtual ~VclPixelProcessor2D() override;
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index c2c835e5291d..c468da266430 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -824,7 +824,7 @@ void VclProcessor2D::RenderUnifiedTransparencePrimitive2D(
else if (rTransCandidate.getTransparence() > 0.0 && rTransCandidate.getTransparence() < 1.0)
{
// transparence is in visible range
- basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
@@ -853,7 +853,7 @@ void VclProcessor2D::RenderTransparencePrimitive2D(
if (rTransCandidate.getChildren().empty())
return;
- basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(getViewInformation2D()));
+ basegfx::B2DRange aRange(rTransCandidate.getChildren().getB2DRange(maVisitingParameters));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange);
@@ -893,7 +893,7 @@ void VclProcessor2D::RenderTransformPrimitive2D(
{
// remember current transformation and ViewInformation
const basegfx::B2DHomMatrix aLastCurrentTransformation(maCurrentTransformation);
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new transformations for CurrentTransformation
// and for local ViewInformation2D
@@ -903,14 +903,15 @@ void VclProcessor2D::RenderTransformPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
getViewInformation2D().getVisualizedPage(), getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- updateViewInformation(aViewInformation2D);
+ primitive2d::VisitingParameters aVisitingParameters(aViewInformation2D);
+ updateVisitingParameters(aVisitingParameters);
// process content
process(rTransformCandidate.getChildren());
// restore transformations
maCurrentTransformation = aLastCurrentTransformation;
- updateViewInformation(aLastViewInformation2D);
+ updateVisitingParameters(aLastVisitingParameters);
}
// new XDrawPage for ViewInformation2D
@@ -918,7 +919,7 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate)
{
// remember current transformation and ViewInformation
- const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D());
+ primitive2d::VisitingParameters aLastVisitingParameters(maVisitingParameters);
// create new local ViewInformation2D
const geometry::ViewInformation2D aViewInformation2D(
@@ -926,13 +927,14 @@ void VclProcessor2D::RenderPagePreviewPrimitive2D(
getViewInformation2D().getViewTransformation(), getViewInformation2D().getViewport(),
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list