diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-05-25 22:03:00 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-05-25 22:04:31 +0200 |
commit | ff6347f86f6bae66d21059d68ca0b47a63fb0aa2 (patch) | |
tree | 18ceb5770f18e3310b3c71a8d88d71727ed17c8e /vcl | |
parent | b4bf19321ed9ce2d0e49341193690fef0c7085ea (diff) |
Revert "verify that all results from SalLayoutGlyphsCache match"
For now at least, as this is causing a number of Jenkins Mac failures,
even though it originally passed (and still occassionally does).
This reverts commit 04a36851aab1272c9c21ac97d0fc0f4ffe372fe0.
Change-Id: I21454b6ec59e96dfb5f6eb723d4eb8f19948d195
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134955
Tested-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/impglyphitem.cxx | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index 7a4be20c4262..ffed4d56c743 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -295,24 +295,6 @@ static void checkGlyphsEqual(const SalLayoutGlyphs& g1, const SalLayoutGlyphs& g assert(l1->isEqual(l2)); } } - -static void verifyGlyphs(const SalLayoutGlyphs& glyphs, VclPtr<const OutputDevice> outputDevice, - const OUString& text, sal_Int32 nIndex, sal_Int32 nLen, - tools::Long nLogicWidth, const vcl::text::TextLayoutCache* layoutCache) -{ - // Check if the cached result really matches what we would get normally. - std::shared_ptr<const vcl::text::TextLayoutCache> tmpLayoutCache; - if (layoutCache == nullptr) - { - tmpLayoutCache = vcl::text::TextLayoutCache::Create(text); - layoutCache = tmpLayoutCache.get(); - } - std::unique_ptr<SalLayout> layout - = outputDevice->ImplLayout(text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, - SalLayoutFlags::GlyphItemsOnly, layoutCache); - assert(layout); - checkGlyphsEqual(glyphs, layout->GetGlyphs()); -} #endif const SalLayoutGlyphs* @@ -327,12 +309,7 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c if (it != mCachedGlyphs.end()) { if (it->second.IsValid()) - { -#ifdef DBG_UTIL - verifyGlyphs(it->second, outputDevice, text, nIndex, nLen, nLogicWidth, layoutCache); -#endif return &it->second; - } // Do not try to create the layout here. If a cache item exists, it's already // been attempted and the layout was invalid (this happens with MultiSalLayout). // So in that case this is a cached failure. @@ -401,8 +378,19 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr<const OutputDevice> outputDevice, c { mLastTemporaryKey = std::move(key); #ifdef DBG_UTIL - verifyGlyphs(mLastTemporaryGlyphs, outputDevice, text, nIndex, nLen, nLogicWidth, - layoutCache); + std::shared_ptr<const vcl::text::TextLayoutCache> tmpLayoutCache; + if (layoutCache == nullptr) + { + tmpLayoutCache = vcl::text::TextLayoutCache::Create(text); + layoutCache = tmpLayoutCache.get(); + } + // Check if the subset result really matches what we would get normally, + // to make sure corner cases are handled well (see SalLayoutGlyphsImpl::cloneCharRange()). + std::unique_ptr<SalLayout> layout + = outputDevice->ImplLayout(text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, + SalLayoutFlags::GlyphItemsOnly, layoutCache); + assert(layout); + checkGlyphsEqual(mLastTemporaryGlyphs, layout->GetGlyphs()); #endif return &mLastTemporaryGlyphs; } |