diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-04-07 12:25:09 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-04-08 21:28:58 +0200 |
commit | 53fe4a26c7c4691fcf9d07d022adfd45247d176b (patch) | |
tree | fbaa0ebe084be4cb0048764e9c33c46b8d7d100e /vcl/source | |
parent | 9ed2912d4ecfd9573b3ca9d2390a0f1b0e3060a2 (diff) |
ignore Point logicalPos argument in SalLayoutGlyphsCache
It's only used for the DXArray argument in ImplLayout(), so if we
ignore that one when caching, the position can be ignored too.
Change-Id: Id2a7b452e2b75139177c1e73c48eaa466742a59c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132672
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/impglyphitem.cxx | 17 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 6 |
2 files changed, 9 insertions, 14 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index ea3c490b0ba2..01654cfddcbc 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -97,13 +97,12 @@ bool SalLayoutGlyphsImpl::IsValid() const const SalLayoutGlyphs* SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, const OUString& text, - sal_Int32 nIndex, sal_Int32 nLen, const Point& rLogicPos, - tools::Long nLogicWidth, + sal_Int32 nIndex, sal_Int32 nLen, tools::Long nLogicWidth, const vcl::text::TextLayoutCache* layoutCache) const { if (nLen == 0) return nullptr; - const CachedGlyphsKey key(outputDevice, text, nIndex, nLen, rLogicPos, nLogicWidth); + const CachedGlyphsKey key(outputDevice, text, nIndex, nLen, nLogicWidth); auto it = mCachedGlyphs.find(key); if (it != mCachedGlyphs.end()) { @@ -121,7 +120,7 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c layoutCache = tmpLayoutCache.get(); } std::unique_ptr<SalLayout> layout - = outputDevice->ImplLayout(text, nIndex, nLen, rLogicPos, nLogicWidth, {}, + = outputDevice->ImplLayout(text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, SalLayoutFlags::GlyphItemsOnly, layoutCache); if (layout) { @@ -134,11 +133,10 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr<const OutputDevice>& d, const OUString& t, sal_Int32 i, sal_Int32 l, - const Point& p, tools::Long w) + tools::Long w) : text(t) , index(i) , len(l) - , logicPos(p) , logicWidth(w) , outputDevice(d) // we also need to save things used in OutputDevice::ImplPrepareLayoutArgs(), in case they @@ -154,8 +152,6 @@ SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr<const Output o3tl::hash_combine(hashValue, vcl::text::FirstCharsStringHash()(text)); o3tl::hash_combine(hashValue, index); o3tl::hash_combine(hashValue, len); - o3tl::hash_combine(hashValue, logicPos.X()); - o3tl::hash_combine(hashValue, logicPos.Y()); o3tl::hash_combine(hashValue, logicWidth); o3tl::hash_combine(hashValue, outputDevice.get()); @@ -170,9 +166,8 @@ SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr<const Output inline bool SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const CachedGlyphsKey& other) const { return hashValue == other.hashValue && index == other.index && len == other.len - && logicPos == other.logicPos && logicWidth == other.logicWidth - && outputDevice == other.outputDevice && rtl == other.rtl - && layoutMode == other.layoutMode + && logicWidth == other.logicWidth && outputDevice == other.outputDevice + && rtl == other.rtl && layoutMode == other.layoutMode && digitLanguage == other.digitLanguage // slower things here && font == other.font && vcl::text::FastStringCompareEqual()(text, other.text); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 65a0827ad68d..1853fe544eeb 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6499,7 +6499,7 @@ void PDFWriterImpl::drawText( const Point& rPos, const OUString& rText, sal_Int3 // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen, rPos ); + const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen ); std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, 0, {}, SalLayoutFlags::NONE, nullptr, layoutGlyphs ); if( pLayout ) @@ -6516,7 +6516,7 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const OUString& rText, o3t // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen, rPos, 0 ); + const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen ); std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, 0, pDXArray, SalLayoutFlags::NONE, nullptr, layoutGlyphs ); if( pLayout ) @@ -6533,7 +6533,7 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen, rPos, nWidth ); + const SalLayoutGlyphs* layoutGlyphs = m_layoutGlyphsCache.GetLayoutGlyphs( this, rText, nIndex, nLen, nWidth ); std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, nWidth, {}, SalLayoutFlags::NONE, nullptr, layoutGlyphs ); if( pLayout ) |