summaryrefslogtreecommitdiff
path: root/drawinglayer/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-30 09:51:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-31 12:10:52 +0100
commit11b15571475414ef853e21a6c96afa2ac81f848f (patch)
treee32da625489c121001e8436fb693b2a25a1e1b6e /drawinglayer/source
parentef085d09e0c019f78a3d35f759c8fe567856b615 (diff)
convert KernArray from sal_Int32 to double
which allows us to eliminate a bunch of rounding at various layers, and consequently maintain a lot more precision Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx12
-rw-r--r--drawinglayer/source/primitive2d/textprimitive2d.cxx12
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx2
3 files changed, 6 insertions, 20 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 67f1311a8010..ac51f8a9e458 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -274,13 +274,8 @@ void TextLayouterDevice::getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPoly
OSL_ENSURE(nDXArrayCount == nTextLength,
"DXArray size does not correspond to text portion size (!)");
- KernArray aIntegerDXArray;
- aIntegerDXArray.reserve(nDXArrayCount);
- for (sal_uInt32 a(0); a < nDXArrayCount; a++)
- aIntegerDXArray.push_back(basegfx::fround(rDXArray[a]));
-
- mrDevice.GetTextOutlines(rB2DPolyPolyVector, rText, nIndex, nIndex, nLength, 0,
- aIntegerDXArray, rKashidaArray);
+ mrDevice.GetTextOutlines(rB2DPolyPolyVector, rText, nIndex, nIndex, nLength, 0, rDXArray,
+ rKashidaArray);
}
else
{
@@ -374,8 +369,7 @@ TextLayouterDevice::getSalLayout(const OUString& rText, sal_uInt32 nIndex, sal_u
SalLayoutGlyphsCache::self()->GetLayoutGlyphs(&mrDevice, rText, nIndex, nLength));
const Point aStartPoint(basegfx::fround<tools::Long>(rStartPoint.getX()),
basegfx::fround<tools::Long>(rStartPoint.getY()));
- KernArraySpan aKernArraySpan(rDXArray);
- return mrDevice.ImplLayout(rText, nIndex, nLength, aStartPoint, 0, aKernArraySpan, pKashidaAry,
+ return mrDevice.ImplLayout(rText, nIndex, nLength, aStartPoint, 0, rDXArray, pKashidaAry,
SalLayoutFlags::NONE, nullptr, pGlyphs);
}
diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx
index db9a6359ccf2..d08f729e3abf 100644
--- a/drawinglayer/source/primitive2d/textprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx
@@ -353,22 +353,14 @@ void TextSimplePortionPrimitive2D::createTextLayouter(TextLayouterDevice& rTextL
std::unique_ptr<SalLayout>
TextSimplePortionPrimitive2D::createSalLayout(TextLayouterDevice& rTextLayouter) const
{
- // create integer DXArray. As mentioned above we can act in the
+ // As mentioned above we can act in the
// Text's local coordinate system without transformation at all
const ::std::vector<double>& rDXArray(getDXArray());
- KernArray aDXArray;
-
- if (!rDXArray.empty())
- {
- aDXArray.reserve(rDXArray.size());
- for (auto const& elem : rDXArray)
- aDXArray.push_back(basegfx::fround(elem));
- }
// create SalLayout. No need for a position, as mentioned text can work
// without transformations, so start point is always 0,0
return rTextLayouter.getSalLayout(getText(), getTextPosition(), getTextLength(),
- basegfx::B2DPoint(0.0, 0.0), aDXArray, getKashidaArray());
+ basegfx::B2DPoint(0.0, 0.0), rDXArray, getKashidaArray());
}
// provide unique ID
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 2e3a7c08f7cf..73e3d8adbac9 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -309,7 +309,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
aDXArray.reserve(rTextCandidate.getDXArray().size());
for (auto const& elem : rTextCandidate.getDXArray())
- aDXArray.push_back(basegfx::fround(elem * fPixelVectorFactor));
+ aDXArray.push_back(elem * fPixelVectorFactor);
}
// set parameters and paint text snippet