[Interest] QOpenGLWidget strokes premul, while QWidget is straight?
David M. Cotter
dave at kjams.com
Fri Dec 6 02:21:22 CET 2019
referring to this article <https://forum.qt.io/topic/5327/how-to-use-semi-transparent-qpixmaps-as-textures>, i see someone else has also run into this, but did not get a satisfactory answer.
I am implementing what on macOS Carbon is known as a "transparency layer", that is, you begin a transparency context, do your drawing (with transparency), finish your context, then blit the contents of that context as a whole with a specified transparency (this is to achieve "fade away" via animation).
When i use QWidget, my stroked paths (text) look creamy smooth along the edges, as if everything is in fact being handled as straight alpha:
However, if i switch to using QOpenGLWidget, my stroked paths appear to have a crusty border, as if they were drawn with premul-over-black alpha:
No other code changes except swapping QOpenGLWidget for QWidget.
Does this seem... unexpected? Note if i attempt to manually unmultiply, things look much worse, so i don't think it's PRECISELY a premul thing. (and i know my manual unmultiply works because unit tests)
(Ignore for now the fact that it's white-on-white, i know that, i'm NOT drawing the black text behind the stroke to more clearly illustrate the halo around the strokes)
-dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20191205/1c047016/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwidget.png
Type: image/png
Size: 50712 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20191205/1c047016/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qoglwidget.png
Type: image/png
Size: 54435 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20191205/1c047016/attachment-0003.png>
More information about the Interest
mailing list