diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-06-16 08:21:21 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-06-16 08:21:21 (GMT) |
commit | 8d1ba7ebfb59d68dfdb4d7094c34208eeab4eae0 (patch) | |
tree | 3fe0c46246ceb83b798f298c8d9fe02a86d2764f | |
parent | 242db2799df091278517623b3823f0eefc0fa42e (diff) | |
parent | cf429b48cf144a4f6fa1b7e96ed00f5ce3fe085b (diff) | |
download | Qt-8d1ba7ebfb59d68dfdb4d7094c34208eeab4eae0.zip Qt-8d1ba7ebfb59d68dfdb4d7094c34208eeab4eae0.tar.gz Qt-8d1ba7ebfb59d68dfdb4d7094c34208eeab4eae0.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
-rw-r--r-- | src/gui/image/qimage.cpp | 8 | ||||
-rw-r--r-- | src/gui/image/qpixmapdata.cpp | 5 | ||||
-rw-r--r-- | src/gui/image/qpixmapdata_p.h | 2 | ||||
-rw-r--r-- | src/gui/image/qvolatileimage.cpp | 35 | ||||
-rw-r--r-- | src/gui/image/qvolatileimage_p.h | 1 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_s60.cpp | 30 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_s60_p.h | 2 | ||||
-rw-r--r-- | src/opengl/qgl_symbian.cpp | 1 | ||||
-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 | ||||
-rw-r--r-- | src/s60installs/bwins/QtGuiu.def | 2 | ||||
-rw-r--r-- | src/s60installs/bwins/QtNetworku.def | 2 | ||||
-rw-r--r-- | src/s60installs/bwins/QtOpenGLu.def | 1 | ||||
-rw-r--r-- | src/s60installs/bwins/QtOpenVGu.def | 1 | ||||
-rw-r--r-- | src/s60installs/eabi/QtCoreu.def | 13 | ||||
-rw-r--r-- | src/s60installs/eabi/QtGuiu.def | 2 | ||||
-rw-r--r-- | src/s60installs/eabi/QtNetworku.def | 2 | ||||
-rw-r--r-- | src/s60installs/eabi/QtOpenVGu.def | 1 |
19 files changed, 86 insertions, 32 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 65793af..d7156a7 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -62,7 +62,11 @@ #include <qhash.h> +#if defined(Q_OS_SYMBIAN) +#include <private/qpaintengine_s60_p.h> +#else #include <private/qpaintengine_raster_p.h> +#endif #include <private/qimage_p.h> @@ -5706,7 +5710,11 @@ QPaintEngine *QImage::paintEngine() const return 0; if (!d->paintEngine) { +#ifdef Q_OS_SYMBIAN + d->paintEngine = new QS60PaintEngine(const_cast<QImage *>(this)); +#else d->paintEngine = new QRasterPaintEngine(const_cast<QImage *>(this)); +#endif } return d->paintEngine; diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index c46429c..934dbb8 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -276,6 +276,11 @@ QImage* QPixmapData::buffer() } #if defined(Q_OS_SYMBIAN) +QVolatileImage QPixmapData::toVolatileImage() const +{ + return QVolatileImage(); +} + void* QPixmapData::toNativeType(NativeType /* type */) { return 0; diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 099c61c..cf089fb 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -138,7 +138,7 @@ public: } #if defined(Q_OS_SYMBIAN) - virtual QVolatileImage toVolatileImage() const { return QVolatileImage(); } + virtual QVolatileImage toVolatileImage() const; virtual void* toNativeType(NativeType type); virtual void fromNativeType(void* pixmap, NativeType type); #endif diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp index b8612b1..9734c82 100644 --- a/src/gui/image/qvolatileimage.cpp +++ b/src/gui/image/qvolatileimage.cpp @@ -200,6 +200,16 @@ QImage &QVolatileImage::imageRef() // non-const, in order to cause a detach return d->image; } +/*! + Non-detaching version, for read-only access only. + Must be guarded by begin/endDataAccess(). + */ +const QImage &QVolatileImage::constImageRef() const +{ + const_cast<QVolatileImageData *>(d.data())->ensureImage(); + return d->image; +} + void *QVolatileImage::duplicateNativeImage() const { return d->duplicateNativeImage(); @@ -289,12 +299,14 @@ bool QVolatileImagePaintEngine::end() void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm) { #ifdef Q_OS_SYMBIAN - void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage); - if (nativeData) { - QVolatileImage *img = static_cast<QVolatileImage *>(nativeData); - img->beginDataAccess(); - QRasterPaintEngine::drawImage(p, img->imageRef()); - img->endDataAccess(true); + QVolatileImage img = pm.pixmapData()->toVolatileImage(); + if (!img.isNull()) { + img.beginDataAccess(); + // imageRef() would detach and since we received the QVolatileImage from + // toVolatileImage() by value, it would cause a copy which would ruin + // our goal. So use constImageRef() instead. + QRasterPaintEngine::drawImage(p, img.constImageRef()); + img.endDataAccess(true); } else { QRasterPaintEngine::drawPixmap(p, pm); } @@ -306,12 +318,11 @@ void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm) void QVolatileImagePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) { #ifdef Q_OS_SYMBIAN - void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage); - if (nativeData) { - QVolatileImage *img = static_cast<QVolatileImage *>(nativeData); - img->beginDataAccess(); - QRasterPaintEngine::drawImage(r, img->imageRef(), sr); - img->endDataAccess(true); + QVolatileImage img = pm.pixmapData()->toVolatileImage(); + if (!img.isNull()) { + img.beginDataAccess(); + QRasterPaintEngine::drawImage(r, img.constImageRef(), sr); + img.endDataAccess(true); } else { QRasterPaintEngine::drawPixmap(r, pm, sr); } diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h index 97d6ea6..bed2e91 100644 --- a/src/gui/image/qvolatileimage_p.h +++ b/src/gui/image/qvolatileimage_p.h @@ -87,6 +87,7 @@ public: bool ensureFormat(QImage::Format format); QImage toImage() const; QImage &imageRef(); + const QImage &constImageRef() const; QPaintEngine *paintEngine(); void setAlphaChannel(const QPixmap &alphaChannel); void fill(uint pixelValue); diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp index 091e2e6..fd7bea2 100644 --- a/src/gui/painting/qpaintengine_s60.cpp +++ b/src/gui/painting/qpaintengine_s60.cpp @@ -60,7 +60,7 @@ bool QS60PaintEngine::begin(QPaintDevice *device) { Q_D(QS60PaintEngine); - if (pixmapData->classId() == QPixmapData::RasterClass) { + if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) { pixmapData->beginDataAccess(); bool ret = QRasterPaintEngine::begin(device); // Make sure QPaintEngine::paintDevice() returns the proper device. @@ -69,13 +69,12 @@ bool QS60PaintEngine::begin(QPaintDevice *device) d->pdev = device; return ret; } - return QRasterPaintEngine::begin(device); } bool QS60PaintEngine::end() { - if (pixmapData->classId() == QPixmapData::RasterClass) { + if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) { bool ret = QRasterPaintEngine::end(); pixmapData->endDataAccess(); return ret; @@ -91,12 +90,14 @@ void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm) QRasterPaintEngine::drawPixmap(p, pm); srcData->endDataAccess(); } else { - void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage); - if (nativeData) { - QVolatileImage *img = static_cast<QVolatileImage *>(nativeData); - img->beginDataAccess(); - QRasterPaintEngine::drawImage(p, img->imageRef()); - img->endDataAccess(true); + QVolatileImage img = pm.pixmapData()->toVolatileImage(); + if (!img.isNull()) { + img.beginDataAccess(); + // imageRef() would detach and since we received the QVolatileImage + // from toVolatileImage() by value, it would cause a copy which + // would ruin our goal. So use constImageRef() instead. + QRasterPaintEngine::drawImage(p, img.constImageRef()); + img.endDataAccess(true); } else { QRasterPaintEngine::drawPixmap(p, pm); } @@ -111,12 +112,11 @@ void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRect QRasterPaintEngine::drawPixmap(r, pm, sr); srcData->endDataAccess(); } else { - void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage); - if (nativeData) { - QVolatileImage *img = static_cast<QVolatileImage *>(nativeData); - img->beginDataAccess(); - QRasterPaintEngine::drawImage(r, img->imageRef(), sr); - img->endDataAccess(true); + QVolatileImage img = pm.pixmapData()->toVolatileImage(); + if (!img.isNull()) { + img.beginDataAccess(); + QRasterPaintEngine::drawImage(r, img.constImageRef(), sr); + img.endDataAccess(true); } else { QRasterPaintEngine::drawPixmap(r, pm, sr); } diff --git a/src/gui/painting/qpaintengine_s60_p.h b/src/gui/painting/qpaintengine_s60_p.h index 2a3b443..5535c24 100644 --- a/src/gui/painting/qpaintengine_s60_p.h +++ b/src/gui/painting/qpaintengine_s60_p.h @@ -65,7 +65,7 @@ class QS60PaintEngine : public QRasterPaintEngine Q_DECLARE_PRIVATE(QS60PaintEngine) public: - QS60PaintEngine(QPaintDevice *device, QS60PixmapData* data); + QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data = 0); bool begin(QPaintDevice *device); bool end(); diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 86176c9..20c2170 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -437,7 +437,6 @@ void* QGLPixmapData::toNativeType(NativeType type) m_source = QVolatileImage(w, h, QImage::Format_ARGB32_Premultiplied); return m_source.duplicateNativeImage(); } - return 0; } 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 diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index ca4af4a..9b70ee8 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -13111,4 +13111,6 @@ EXPORTS ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13110 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool) ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13111 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void) ?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 13112 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) + ?constImageRef@QVolatileImage@@QBEABVQImage@@XZ @ 13113 NONAME ; class QImage const & QVolatileImage::constImageRef(void) const + ?toVolatileImage@QPixmapData@@UBE?AVQVolatileImage@@XZ @ 13114 NONAME ; class QVolatileImage QPixmapData::toVolatileImage(void) const diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index b3137d8..274b821 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -1159,4 +1159,6 @@ EXPORTS ??4QIPv6Address@@QAEAAV0@ABV0@@Z @ 1158 NONAME ABSENT ; class QIPv6Address & QIPv6Address::operator=(class QIPv6Address const &) ??_EQNetworkAddressEntry@@QAE@I@Z @ 1159 NONAME ABSENT ; QNetworkAddressEntry::~QNetworkAddressEntry(unsigned int) ??_EQNetworkCookie@@QAE@I@Z @ 1160 NONAME ABSENT ; QNetworkCookie::~QNetworkCookie(unsigned int) + ?cleanup@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1161 NONAME ; void QNetworkConfigurationManagerPrivate::cleanup(void) + ?initialize@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1162 NONAME ; void QNetworkConfigurationManagerPrivate::initialize(void) diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def index 75c0d5e..af25e7e 100644 --- a/src/s60installs/bwins/QtOpenGLu.def +++ b/src/s60installs/bwins/QtOpenGLu.def @@ -724,4 +724,5 @@ EXPORTS ?initFromNativeImageHandle@QGLPixmapData@@QAE_NPAXABVQString@@@Z @ 723 NONAME ; bool QGLPixmapData::initFromNativeImageHandle(void *, class QString const &) ?platformExtension@QGLGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 724 NONAME ; class QGraphicsSystemEx * QGLGraphicsSystem::platformExtension(void) ?releaseCachedGpuResources@QGLGraphicsSystem@@UAEXXZ @ 725 NONAME ; void QGLGraphicsSystem::releaseCachedGpuResources(void) + ?toVolatileImage@QGLPixmapData@@UBE?AVQVolatileImage@@XZ @ 726 NONAME ; class QVolatileImage QGLPixmapData::toVolatileImage(void) const diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def index f2433d6..9812757 100644 --- a/src/s60installs/bwins/QtOpenVGu.def +++ b/src/s60installs/bwins/QtOpenVGu.def @@ -184,4 +184,5 @@ EXPORTS ?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) + ?toVolatileImage@QVGPixmapData@@UBE?AVQVolatileImage@@XZ @ 186 NONAME ; class QVolatileImage QVGPixmapData::toVolatileImage(void) const diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index fce55dd..f92cb5a 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -3717,4 +3717,17 @@ EXPORTS _ZN23QCoreApplicationPrivate18symbianCommandLineEv @ 3716 NONAME _ZNK11QMetaMethod8revisionEv @ 3717 NONAME _ZNK13QMetaProperty8revisionEv @ 3718 NONAME + _ZN5RHeap10Extension_EjRPvS0_ @ 3719 NONAME + _ZN5RHeap13DebugFunctionEiPvS0_ @ 3720 NONAME + _ZN5RHeap4FreeEPv @ 3721 NONAME + _ZN5RHeap5AllocEi @ 3722 NONAME + _ZN5RHeap5ResetEv @ 3723 NONAME + _ZN5RHeap7ReAllocEPvii @ 3724 NONAME + _ZN5RHeap8CompressEv @ 3725 NONAME + _ZN8UserHeap15OffsetChunkHeapE6RChunkiiiiiim @ 3726 NONAME + _ZN8UserHeap16CreateThreadHeapER24SStdEpocThreadCreateInfoRP5RHeapii @ 3727 NONAME + _ZN8UserHeap9ChunkHeapE6RChunkiiiiim @ 3728 NONAME + _ZNK5RHeap8AllocLenEPKv @ 3729 NONAME + _ZNK5RHeap9AllocSizeERi @ 3730 NONAME + _ZNK5RHeap9AvailableERi @ 3731 NONAME diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index d0c789f..0f9442d 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12195,4 +12195,6 @@ EXPORTS _ZTI17QGraphicsSystemEx @ 12194 NONAME _ZTI24QSymbianGraphicsSystemEx @ 12195 NONAME _ZTV24QSymbianGraphicsSystemEx @ 12196 NONAME + _ZNK11QPixmapData15toVolatileImageEv @ 12197 NONAME + _ZNK14QVolatileImage13constImageRefEv @ 12198 NONAME diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def index f13fab3..86a61e8 100644 --- a/src/s60installs/eabi/QtNetworku.def +++ b/src/s60installs/eabi/QtNetworku.def @@ -1168,4 +1168,6 @@ EXPORTS _ZTV35QNetworkConfigurationManagerPrivate @ 1167 NONAME _ZThn8_N19QBearerEnginePluginD0Ev @ 1168 NONAME _ZThn8_N19QBearerEnginePluginD1Ev @ 1169 NONAME + _ZN35QNetworkConfigurationManagerPrivate10initializeEv @ 1170 NONAME + _ZN35QNetworkConfigurationManagerPrivate7cleanupEv @ 1171 NONAME diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def index 08afd61..e169ff8 100644 --- a/src/s60installs/eabi/QtOpenVGu.def +++ b/src/s60installs/eabi/QtOpenVGu.def @@ -214,4 +214,5 @@ EXPORTS _ZN13QVGPixmapData25initFromNativeImageHandleEPvRK7QString @ 213 NONAME _ZN13QVGPixmapData35createFromNativeImageHandleProviderEv @ 214 NONAME _ZN13QVGPixmapData12forceToImageEb @ 215 NONAME + _ZNK13QVGPixmapData15toVolatileImageEv @ 216 NONAME |