diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-24 14:29:26 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-03-24 14:29:26 (GMT) |
commit | 83d33a9f64d1472926c61e472655182e539a8e10 (patch) | |
tree | 66895fbcb4b8defc2ea526b13419606485fa1d85 /src/openvg | |
parent | e087227d6bb2c8f66f518f57aa18452d05658d72 (diff) | |
download | Qt-83d33a9f64d1472926c61e472655182e539a8e10.zip Qt-83d33a9f64d1472926c61e472655182e539a8e10.tar.gz Qt-83d33a9f64d1472926c61e472655182e539a8e10.tar.bz2 |
Fix an issue with VGImage readback in openvg.
The special case of creating a pixmap from RSgImage via a native
handle provider needs extra attention when hibernating: In this case
the hibernating happens as usual, however doing a readback would
produce unwanted results and must be avoided.
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 7 | ||||
-rw-r--r-- | src/openvg/qpixmapdata_vg_p.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 3f67c79..80f5b2f 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -458,7 +458,7 @@ void QVGPixmapData::hibernate() if (skipHibernate) return; - forceToImage(); + forceToImage(false); // no readback allowed here destroyImageAndContext(); } @@ -502,12 +502,13 @@ int QVGPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const // Ensures that the pixmap is backed by some valid data and forces the data to // be re-uploaded to the VGImage when toVGImage() is called next time. -void QVGPixmapData::forceToImage() +void QVGPixmapData::forceToImage(bool allowReadback) { if (!isValid()) return; - ensureReadback(false); + if (allowReadback) + ensureReadback(false); if (source.isNull()) source = QVolatileImage(w, h, sourceFormat()); diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h index 15ff889..c284596 100644 --- a/src/openvg/qpixmapdata_vg_p.h +++ b/src/openvg/qpixmapdata_vg_p.h @@ -188,7 +188,7 @@ protected: QString nativeImageType; #endif - void forceToImage(); + void forceToImage(bool allowReadback = true); QImage::Format sourceFormat() const; QImage::Format idealFormat(QImage *image, Qt::ImageConversionFlags flags) const; void updateSerial(); |