summaryrefslogtreecommitdiffstats
path: root/src/openvg/qpaintengine_vg.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-22 08:42:39 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-22 08:42:39 (GMT)
commitdfa9643193134612f3e5d25c5fa4f2a9d1fd6837 (patch)
tree3403f81a26b00fe26c3d93410c2891cb9cb340cd /src/openvg/qpaintengine_vg.cpp
parent6733b02876d0f305691e6fc8060502bb3d783c36 (diff)
downloadQt-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.cpp4
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