Kaydet (Commit) 239d4e0c authored tarafından Tor Lillqvist's avatar Tor Lillqvist

More hacks to glyph rendering for caching with OpenGL on Windows

Change-Id: I934ad7453f35909f4c3ad999e33453b5b6032480
üst df42d081
...@@ -160,7 +160,10 @@ inline std::basic_ostream<charT, traits> & operator <<( ...@@ -160,7 +160,10 @@ inline std::basic_ostream<charT, traits> & operator <<(
stream << "{"; stream << "{";
for (auto i = rCache.cbegin(); i != rCache.cend(); ++i) 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()) if (i+1 != rCache.cend())
{ {
stream << ","; stream << ",";
...@@ -278,10 +281,16 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou ...@@ -278,10 +281,16 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
int totWidth = 0; int totWidth = 0;
for (int i = 0; i < nCount; i++) 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]; totWidth += aDX[i];
} }
SAL_INFO("vcl.gdi.opengl", "aSize=(" << aSize.cx << "," << aSize.cy << ") totWidth=" << totWidth);
if (SelectObject(hDC, hOrigFont) == NULL) if (SelectObject(hDC, hOrigFont) == NULL)
SAL_WARN("vcl.gdi", "SelectObject failed: " << WindowsErrorString(GetLastError())); SAL_WARN("vcl.gdi", "SelectObject failed: " << WindowsErrorString(GetLastError()));
if (!DeleteDC(hDC)) if (!DeleteDC(hDC))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment