Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-43039

QPainter does not correctly draw Text after Linear Gradient Background

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.4.1
    • 5.4.0 RC
    • GUI: OpenGL, GUI: Painting
    • None

      When QPainter render following Sequences, it loose context.
      1. Text rendering
      2. Linear Gradient Background rendering
      3. Text over Linear Gradient Background rendering

      First, texture binding for text happens at step 1 and store current texture id for text rendering.
      After that, new texture binding happens at step 2 for linear gradient.
      But prevously used texture id still preserved and used at step 3.
      So, QPainter does not rebinding texture of text.

      <!DOCTYPE html>
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      </head>
      <body>
      
      <div style="font-size:40px; position: absolute; top: 10px; left: 10px;">
      X
      </div>
      <div style="font-size:40px; position: absolute; top: 110px; left: 20px; background-image: -webkit-linear-gradient(left, rgb(46, 100, 101) 0%, rgb(46, 100, 101) 100%);">
      XXXXABCD1
      </div>
      </body>
      </html>
      

      Code Review: https://codereview.qt-project.org/#/c/101262/

        1. Image-NG.png
          6 kB
          Byungseon Shin
        2. Image-OK.png
          12 kB
          Byungseon Shin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            vestbo Tor Arne Vestbø
            sun.shin Byungseon Shin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes