diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-22 08:42:39 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-22 08:42:39 (GMT) |
commit | dfa9643193134612f3e5d25c5fa4f2a9d1fd6837 (patch) | |
tree | 3403f81a26b00fe26c3d93410c2891cb9cb340cd /src/openvg/qpaintengine_vg.cpp | |
parent | 6733b02876d0f305691e6fc8060502bb3d783c36 (diff) | |
download | Qt-dfa9643193134612f3e5d25c5fa4f2a9d1fd6837.zip Qt-dfa9643193134612f3e5d25c5fa4f2a9d1fd6837.tar.gz Qt-dfa9643193134612f3e5d25c5fa4f2a9d1fd6837.tar.bz2 |
Fixed drawImage() not to attempt drawing null images on openvg.
QVGPaintEngine did not have proper checks for null QImage in the
drawImage functions so it went on trying to create a VGImage of
size 0x0 which is bound to fail always. This resulted in confusing
warnings about not being able to reclaim space for 0x0 images.
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 3d50558..44dceea 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -3181,6 +3181,8 @@ void QVGPaintEngine::drawImage Qt::ImageConversionFlags flags) { Q_D(QVGPaintEngine); + if (image.isNull()) + return; VGImage vgImg; if (d->simpleTransform || d->opacity == 1.0f) vgImg = toVGImageSubRect(image, sr.toRect(), flags); @@ -3226,6 +3228,8 @@ void QVGPaintEngine::drawImage void QVGPaintEngine::drawImage(const QPointF &pos, const QImage &image) { Q_D(QVGPaintEngine); + if (image.isNull()) + return; VGImage vgImg; if (canVgWritePixels(image)) { // Optimization for straight blits, no blending |