summaryrefslogtreecommitdiff
path: root/sw/qa/python
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-12-18 14:38:27 +0200
committerTor Lillqvist <tml@collabora.com>2015-12-18 14:42:11 +0200
commit61085083e4a5060ba7e2135818264d63c6da13c2 (patch)
treec8a3ffa89e1b50c39a979383d65f2cb6da7e6045 /sw/qa/python
parent4336db6d89a8531673fdbac790692a89f3c1fe79 (diff)
tdf#95054: Make sure glyphs alpha blend properly in the Graphite+OpenGL case
The problem apparently was that the GraphiteWinLayout::DrawTextImpl() function drew each glyph using a separate call to ExtTextOutW(). That mishandled anti-aliased glyphs (alpha), somewhat in the way as described in the nice long comment (thanks kendy!) in WinLayout::DrawText(). The irony here is that in the case of Graphite fonts and OpenGL, it is exactly from that code block in WinLayout::DrawText() that GraphiteWinLayout::DrawTextImpl() gets called, and in that situation it itself runs into the same or similar problem as the calling code wants to avoid for the run as a whole. It draws each glyph separately, and subsequent glyphs will overwrite the rightmost pixels of the earlier one instead of blend properly. Or something like that. As a solution, change the interface of DrawTextImpl() so that instead of being called once to draw a run of text, it might draw just a part of the run, and in that case expects to be called repeatedly to draw the whole text. The GraphiteWinLayout::DrawTextImpl() implementation does it like this in the case of using OpenGL (as indicated by the presence of a non-null pRectToErase, as added in b7842c93dc06b831d3fa649410ed847358ce9d17 for tdf#95648). The end result is that it draws one glyph at a time into the DC for the bitmap allocated in the caller, WinLayout::DrawText(). The caller uses that bitmap as a texture and blends it into the actual destination, separately for each glyph. For non-Graphite fonts, or when not using OpenGL, nothing should change. No repeated DrawTextImpl calls are done to iterate over a run. Change-Id: Ib7adc30665fc7804913fd2f8886c5b29d9ca42c4
Diffstat (limited to 'sw/qa/python')
0 files changed, 0 insertions, 0 deletions