title: SVG rasterization issue in a QML Canvas
body: <p>I am experiencing issues when using the QML Canvas <a href="http://doc.qt.io/qt-5/qml-qtquick-context2d.html#drawImage-method-1" rel="nofollow noreferrer">drawImage</a> method to render SVG icons.
  Basically the QML Canvas ignores the rasterization size and paint the image starting from its original size (in this case 48x48px), and scaling it up with an ugly aliasing effect.</p>
  
  <p>Has anyone ever seen this and possibly figured out a solution ?</p>
  
  <p>Please see <a href="https://bugreports.qt.io/browse/QTBUG-59878" rel="nofollow noreferrer">QTBUG-59878</a> for a working self-contained example.
  Here I'm gonna copy just the QML code and a screenshot of what I see.</p>
  
  <p><a href="https://i.stack.imgur.com/O70nS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O70nS.png" alt="enter image description here"></a></p>
  
  <p>From the left:</p>
  
  <ul>
  <li>the original SVG icon as Image item (correct)</li>
  <li>the same Image item rendered by drawImage (to be honest I expected this to be correct as well, since rasterized data should be provided by Image)</li>
  <li>the SVG icon loaded with the procedure explained in the <a href="http://doc.qt.io/qt-5/qtquick-canvas-example.html" rel="nofollow noreferrer">documentation</a>, with loadImage and onImageLoaded</li>
  </ul>
  
  <p>import QtQuick 2.0</p>
  
  <pre><code>Rectangle
  {
      width: 640
      height: 480
  
      Image
      {
          id: svgIcon
          source: "qrc:/qt_logo.svg"
          x: 10
          y: 100
          width: 180
          height: 200
          sourceSize: Qt.size(width, height)
      }
  
      Canvas
      {
          id: canvas
          anchors.fill: parent
          contextType: "2d"
          property string imagefile: "qrc:/qt_logo.svg"
  
          Component.onCompleted: context.loadImage(imagefile)
  
          onImageLoaded: requestPaint()
  
          onPaint:
          {
              context.drawImage(svgIcon, 200, 100, 180, 200)
              context.drawImage(imagefile, 400, 100, 180, 200)
          }
      }
  }
  </code></pre>