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 | |
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')
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 7 | ||||
-rw-r--r-- | src/openvg/qpixmapdata_vg_p.h | 2 | ||||
-rw-r--r-- | src/s60installs/bwins/QtOpenVGu.def | 3 | ||||
-rw-r--r-- | src/s60installs/eabi/QtOpenVGu.def | 3 |
4 files changed, 9 insertions, 6 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(); diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index 18f576b..f2433d6 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -134,7 +134,7 @@ EXPORTS ?drawTextItem@QVGPaintEngine@@UAEXABVQPointF@@ABVQTextItem@@@Z @ 133 NONAME ; void QVGPaintEngine::drawTextItem(class QPointF const &, class QTextItem const &) ?clearScissor@QVGCompositionHelper@@QAEXXZ @ 134 NONAME ; void QVGCompositionHelper::clearScissor(void) ?fill@QVGPaintEngine@@UAEXABVQVectorPath@@ABVQBrush@@@Z @ 135 NONAME ; void QVGPaintEngine::fill(class QVectorPath const &, class QBrush const &) - ?forceToImage@QVGPixmapData@@IAEXXZ @ 136 NONAME ; void QVGPixmapData::forceToImage(void) + ?forceToImage@QVGPixmapData@@IAEXXZ @ 136 NONAME ABSENT ; void QVGPixmapData::forceToImage(void) ?drawPoints@QVGPaintEngine@@UAEXPBVQPoint@@H@Z @ 137 NONAME ; void QVGPaintEngine::drawPoints(class QPoint const *, int) ??_EQVGPaintEngine@@UAE@I@Z @ 138 NONAME ; QVGPaintEngine::~QVGPaintEngine(unsigned int) ?clip@QVGPaintEngine@@UAEXABVQPainterPath@@W4ClipOperation@Qt@@@Z @ 139 NONAME ; void QVGPaintEngine::clip(class QPainterPath const &, enum Qt::ClipOperation) @@ -183,4 +183,5 @@ EXPORTS ?initFromNativeImageHandle@QVGPixmapData@@QAE_NPAXABVQString@@@Z @ 182 NONAME ; bool QVGPixmapData::initFromNativeImageHandle(void *, class QString const &) ?createFromNativeImageHandleProvider@QVGPixmapData@@QAEXXZ @ 183 NONAME ; void QVGPixmapData::createFromNativeImageHandleProvider(void) ?releaseNativeImageHandle@QVGPixmapData@@QAEXXZ @ 184 NONAME ; void QVGPixmapData::releaseNativeImageHandle(void) + ?forceToImage@QVGPixmapData@@IAEX_N@Z @ 185 NONAME ; void QVGPixmapData::forceToImage(bool) diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def index 25c53b8..08afd61 100644 --- a/src/s60installs/eabi/QtOpenVGu.def +++ b/src/s60installs/eabi/QtOpenVGu.def @@ -8,7 +8,7 @@ EXPORTS _Z25qt_vg_create_paint_enginev @ 7 NONAME _Z26qt_vg_destroy_paint_engineP14QVGPaintEngine @ 8 NONAME _Z28qt_vg_config_to_image_formatP11QEglContext @ 9 NONAME - _ZN13QVGPixmapData12forceToImageEv @ 10 NONAME + _ZN13QVGPixmapData12forceToImageEv @ 10 NONAME ABSENT _ZN13QVGPixmapData12toNativeTypeEN11QPixmapData10NativeTypeE @ 11 NONAME _ZN13QVGPixmapData14fromNativeTypeEPvN11QPixmapData10NativeTypeE @ 12 NONAME _ZN13QVGPixmapData15setAlphaChannelERK7QPixmap @ 13 NONAME @@ -213,4 +213,5 @@ EXPORTS _ZN13QVGPixmapData24releaseNativeImageHandleEv @ 212 NONAME _ZN13QVGPixmapData25initFromNativeImageHandleEPvRK7QString @ 213 NONAME _ZN13QVGPixmapData35createFromNativeImageHandleProviderEv @ 214 NONAME + _ZN13QVGPixmapData12forceToImageEb @ 215 NONAME |