summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-08-19 09:18:37 +0300
committerTor Lillqvist <tml@collabora.com>2015-08-19 09:27:08 +0300
commit239d4e0cbd7d0c4e3504528b8dcf5e10fbea9a0b (patch)
tree39f776ead7a21bbd674447b3218bce3082fb7e6f
parentdf42d08191fd76b38d58a317f9aca804e10df062 (diff)
More hacks to glyph rendering for caching with OpenGL on Windows
Change-Id: I934ad7453f35909f4c3ad999e33453b5b6032480
-rw-r--r--vcl/win/source/gdi/winlayout.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 0ab9cd9add16..7f4c4a4f5ed7 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -160,7 +160,10 @@ inline std::basic_ostream<charT, traits> & operator <<(
stream << "{";
for (auto i = rCache.cbegin(); i != rCache.cend(); ++i)
{
- stream << "[" << i->mnFirstGlyph << ".." << (i->mnFirstGlyph + i->mnGlyphCount - 1) << "]";
+ stream << "[" << i->mnFirstGlyph;
+ if (i->mnGlyphCount > 1)
+ stream << ".." << (i->mnFirstGlyph + i->mnGlyphCount - 1);
+ stream << "]";
if (i+1 != rCache.cend())
{
stream << ",";
@@ -278,10 +281,16 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
int totWidth = 0;
for (int i = 0; i < nCount; i++)
{
- aDX[i] = std::abs(aABC[i].abcA) + aABC[i].abcB + std::abs(aABC[i].abcC);
+ aDX[i] = aABC[i].abcB + std::abs(aABC[i].abcC);
+ if (i == 0)
+ aDX[0] += std::abs(aABC[0].abcA);
+ if (i < nCount-1)
+ aDX[i] += std::abs(aABC[i+1].abcA);
totWidth += aDX[i];
}
+ SAL_INFO("vcl.gdi.opengl", "aSize=(" << aSize.cx << "," << aSize.cy << ") totWidth=" << totWidth);
+
if (SelectObject(hDC, hOrigFont) == NULL)
SAL_WARN("vcl.gdi", "SelectObject failed: " << WindowsErrorString(GetLastError()));
if (!DeleteDC(hDC))