vcl/source/gdi/impglyphitem.cxx |   38 +++++++++++++-------------------------
 1 file changed, 13 insertions(+), 25 deletions(-)

New commits:
commit ff6347f86f6bae66d21059d68ca0b47a63fb0aa2
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed May 25 22:03:00 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed May 25 22:04:31 2022 +0200

    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.lu...@collabora.com>
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

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;
             }

Reply via email to