summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpixmapdata_vg.cpp7
-rw-r--r--src/openvg/qpixmapdata_vg_p.h2
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();