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

Canvas.FramebufferObject broken rendering for small Canvas size (<50)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 5.15.2
    • None
    • All

      Run this in qmlscene. If bug is true, it will render a window that is 50% white, and 50% green. If bug is false, the window is 100% green. If you do not set the render target, the bug is gone. Setting a canvasSize has no effect on the bug.

      This seems to be quite a nasty rounding error.

      The only workaround we have found is to not render so small things.

      Unable to find source-code formatter for language: qml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      import QtQuick 2.14
      
      Item {
          id: root
          width: 100
          
          property bool bug: true
          
          height: bug ? 30 : 75
      
          Canvas {
              renderTarget: Canvas.FramebufferObject // comment out to remove bug
              anchors.fill: parent
      
              onPaint: {
                  var ctx = getContext('2d')
                  ctx.lineCap = "square"
                  ctx.clearRect(0, 0, width, height)
      
                  ctx.fillStyle = Qt.rgba(0, 1, 0, 1.0);
                  ctx.fillRect(0, 0, width, height);
              }
          }
      }
      
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            tokorpip Tomi Korpipää
            andrhans Andreas Aardal Hanssen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes