[Interest] QOpenGLWidget noticeable anti-alising halo around text, bitmaps

Pavel Koshevoy pkoshevoy at gmail.com
Wed Jul 8 10:45:51 CEST 2015


Hi,

I am porting existing Qt4-based code to Qt5 (5.5.0), switching from 
QGLWidget to QOpenGLWidget.  In my app I render a bunch of text and 
bitmaps into a transparent QImage.  The QImage is then alpha-blended in 
OpenGL on top of video frame (rendered with OpenGL with texture buffer 
originating from ffmpeg libraries).

I've observed an artifact after the switch to QOpenGLWidget.  It appears 
as if rendering anti-aliased text to a transparent buffer blends a white 
background color into the text outline -- see attached screenshots.  It 
should be red background, black outline, gray text.  What I get is red 
background, whitish anti-aliasing (or alpha-blending) halo around black 
outline, black outline, and gray text.

I don't think the problem is with QPainter::drawText, because I see the 
same whitish halo around bitmap subtitles which I render into the same 
transparent QImage via QPainter::drawImage.  Also, if I use QGLWidget as 
the base class the issue vanishes -- the anti-aliasing halo only appears 
when using QOpenGLWidget.

Is this a bug, or some secret setting I missed?

Thank you,
     Pavel.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: QPainter-drawText-antialiasing-background-color-qglwidget.jpg
Type: image/jpeg
Size: 32107 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150708/73fabcdf/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QPainter-drawText-antialiasing-background-color-qopenglwidget.jpg
Type: image/jpeg
Size: 44081 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150708/73fabcdf/attachment-0001.jpg>


More information about the Interest mailing list