diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-02-23 15:01:03 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-03-15 11:06:59 +0000 |
commit | 04ce76c7211295865e750a2441f94c267ba2f51c (patch) | |
tree | 06d84451236345959a1120ae126382058a000f0d /vcl/win | |
parent | 841a58da93e10f543876eefca470d8fd4bd96ded (diff) |
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@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 9aa23acd41e5..a5ca8e585a62 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++) |