diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-06-15 15:27:55 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-06-16 08:15:03 (GMT) |
commit | 6afe7a233e66f0cae803590d536b4d379b7c1625 (patch) | |
tree | 9885124e37367b7fb2ec967db3c4c4fbdfdcab07 /src/openvg | |
parent | 5e35452ad8420886f54df89d19205acb88ebb363 (diff) | |
download | Qt-6afe7a233e66f0cae803590d536b4d379b7c1625.zip Qt-6afe7a233e66f0cae803590d536b4d379b7c1625.tar.gz Qt-6afe7a233e66f0cae803590d536b4d379b7c1625.tar.bz2 |
Handle QVolatileImage-backed pixmaps optimally in drawPixmap().
When drawing such pixmaps (used by both the openvg and opengl graphics
systems) onto another pixmap or to a QImage, the performance was
sub-optimal due to missing and accidentally disabled support
specific to QVolatileImage. This is now fixed and drawing pixmaps into
a QImage is also made optimal by using the QS60PaintEngine for
QImage too. This will cause a 5-7x (or even up to 12x on certain
hardware and platform) increase in offscreen pixmap drawing
performance.
Task-number: QTBUG-19880
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 3 | ||||
-rw-r--r-- | src/openvg/qpixmapdata_vg_p.h | 2 | ||||
-rw-r--r-- | src/openvg/qvg_symbian.cpp | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index a5d156d..1231abf 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -248,9 +248,10 @@ void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags // same. Detaching is needed to prevent issues with painting // onto this QPixmap later on. convertedImage.detach(); + if (convertedImage.isNull()) + qWarning("QVGPixmapData: Failed to convert image data (out of memory? try increasing heap size)"); source = QVolatileImage(convertedImage); } - recreate = true; } diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h index 18846f3..4a969c0 100644 --- a/src/openvg/qpixmapdata_vg_p.h +++ b/src/openvg/qpixmapdata_vg_p.h @@ -138,7 +138,7 @@ public: QSize size() const { return QSize(w, h); } #if defined(Q_OS_SYMBIAN) - QVolatileImage toVolatileImage() const { return source; } + QVolatileImage toVolatileImage() const; void* toNativeType(NativeType type); void fromNativeType(void* pixmap, NativeType type); bool initFromNativeImageHandle(void *handle, const QString &type); diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index 249b053..98a5869 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -288,6 +288,11 @@ void* QVGPixmapData::toNativeType(NativeType type) return 0; } +QVolatileImage QVGPixmapData::toVolatileImage() const +{ + return source; +} + QSymbianVGFontGlyphCache::QSymbianVGFontGlyphCache() : QVGFontGlyphCache() { #ifdef QT_SYMBIAN_HARDWARE_GLYPH_CACHE |