From dfa9643193134612f3e5d25c5fa4f2a9d1fd6837 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 22 Mar 2011 10:42:39 +0200 Subject: 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 --- src/openvg/qpaintengine_vg.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v0.12