diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-17 15:36:59 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-17 15:36:59 (GMT) |
commit | 54b20c491f7e182f6b98f65b7e9e8e68286d6109 (patch) | |
tree | 7f17d6b2540ea226eb7d8d1b830f31f1a032316a /src/gui/image | |
parent | dcb2678f39345b66c5303e74c156654a8d13fe83 (diff) | |
parent | 17a0a50a101fc9863d0dffd0dcb887ba68a99622 (diff) | |
download | Qt-54b20c491f7e182f6b98f65b7e9e8e68286d6109.zip Qt-54b20c491f7e182f6b98f65b7e9e8e68286d6109.tar.gz Qt-54b20c491f7e182f6b98f65b7e9e8e68286d6109.tar.bz2 |
Merge branch '4.6' into qt-master-from-4.6
Conflicts:
mkspecs/common/symbian/symbian.conf
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
tools/assistant/tools/assistant/helpviewer.cpp
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimagepixmapcleanuphooks.cpp | 21 | ||||
-rw-r--r-- | src/gui/image/qimagepixmapcleanuphooks_p.h | 3 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 9 |
3 files changed, 25 insertions, 8 deletions
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index ace4bb6..517fcb0 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -122,19 +122,32 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) qt_image_cleanup_hook_64(key); } -void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) -{ - enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); -} void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData) { pixmapData->is_cached = true; } +void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) +{ + enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); +} + void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) { const_cast<QImage &>(image).data_ptr()->is_cached = true; } +bool QImagePixmapCleanupHooks::isImageCached(const QImage &image) +{ + return const_cast<QImage &>(image).data_ptr()->is_cached; +} + +bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap) +{ + return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached; +} + + + QT_END_NAMESPACE diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h index 88dd3a6..eae11f4 100644 --- a/src/gui/image/qimagepixmapcleanuphooks_p.h +++ b/src/gui/image/qimagepixmapcleanuphooks_p.h @@ -72,6 +72,9 @@ public: static void enableCleanupHooks(const QPixmap &pixmap); static void enableCleanupHooks(QPixmapData *pixmapData); + static bool isImageCached(const QImage &image); + static bool isPixmapCached(const QPixmap &pixmap); + // Gets called when a pixmap data is about to be modified: void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd); diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 7cafbd0..ae62f06 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1690,10 +1690,9 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) \o The hasAlphaChannel() returns true if the pixmap has a format that - respects the alpha channel, otherwise returns false, while the - hasAlpha() function returns true if the pixmap has an alpha - channel \e or a mask (otherwise false). The mask() function returns - the mask as a QBitmap object, which can be set using setMask(). + respects the alpha channel, otherwise returns false. The hasAlpha(), + setMask() and mask() functions are legacy and should not be used. + They are potentially very slow. The createHeuristicMask() function creates and returns a 1-bpp heuristic mask (i.e. a QBitmap) for this pixmap. It works by @@ -1780,6 +1779,8 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) Returns true if this pixmap has an alpha channel, \e or has a mask, otherwise returns false. + \warning This is potentially an expensive operation. + \sa hasAlphaChannel(), mask() */ bool QPixmap::hasAlpha() const |