Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGLWidget strokes premul, while QWidget is straight?
QtWS25 Last Chance

QOpenGLWidget strokes premul, while QWidget is straight?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 1 Posters 233 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    referring to this article, 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 (basically create a transparent QImage the size of the canvas you're drawing on), 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) (done by first iterating over all pixels and multiplying the alpha channel by the desired transparency, then blitting)

    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:

    QWidget.png

    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:

    QOpenGLWidget.png

    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)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #2

      filed a bug

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        I'm wondering if anybody else cares about this or has a suggested workaround (that is still highly performant) ?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved