[Libreoffice-commits] core.git: vcl/win

Michael Meeks michael.meeks at collabora.com
Tue Mar 15 11:08:12 UTC 2016


 vcl/win/gdi/winlayout.cxx |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 04ce76c7211295865e750a2441f94c267ba2f51c
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Feb 23 15:01:03 2016 +0000

    vcl: improve opengl glyph cache debugging.
    
    Show cutting rectangles, base-lines, and count box widths.
    
    Change-Id: Ic6a08c4c029d6b576ea55479bbf6293accae6f15
    Reviewed-on: https://gerrit.libreoffice.org/23251
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 9aa23ac..a5ca8e5 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -280,17 +280,34 @@ void DumpGlyphBitmap(HDC hDC, const OpenGLGlyphCacheChunk& rChunk)
     SAL_INFO("vcl.gdi.opengl", "Bitmap " << hBitmap << ": " << aBitmap.bmWidth << "x" << aBitmap.bmHeight << ":");
 
     std::ostringstream sLine("\n", std::ios_base::ate);
+    std::ostringstream sScale;
+    long nPrintWidth = std::min(125l, aBitmap.bmWidth);
     for (long y = 0; y < aBitmap.bmHeight; y++)
     {
         if (y == rChunk.mnBaselineOffset + rChunk.getExtraOffset())
-            sLine << "-";
-        else
-            sLine << ColorFor(GetPixel(hDC, 0, y));
-        for (long x = 1; x < std::min(75l, aBitmap.bmWidth); x++)
+            sLine << "--------------------------\n";
+        long n = 0;
+        for (long x = 0; x < nPrintWidth; x++)
+        {
+            // delimit.
+            for (size_t i = 0; i < rChunk.maLocation.size(); ++i)
+            {
+                if (x == rChunk.maLocation[i].Right())
+                {
+                    n = 0;
+                    sLine << '|';
+                    if (y == 0)
+                        sScale << ' ';
+                    break;
+                }
+            }
             sLine << ColorFor(GetPixel(hDC, x, y));
-        if (y < aBitmap.bmHeight - 1)
-            sLine << "\n";
+            if (y == 0)
+                sScale << (n++ % 10);
+        }
+        sLine << "\n";
     }
+    sLine << sScale.str();
     SAL_INFO("vcl.gdi.opengl", sLine.str());
 }
 
@@ -565,7 +582,6 @@ bool WinFontInstance::AddChunkOfGlyphs(bool bRealGlyphIndices, int nGlyphIndex,
 #ifdef SAL_LOG_INFO
     SAL_INFO("vcl.gdi.opengl", "this=" << this << " now: " << maOpenGLGlyphCache);
     DumpGlyphBitmap(aDC.getCompatibleHDC(), aChunk);
-
     {
         std::ostringstream sLine;
         for (int i = 0; i < nCount; i++)


More information about the Libreoffice-commits mailing list