-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 46 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 4 |
2 files changed, 25 insertions, 25 deletions
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index e9fb5a6..d6f4080 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp @@ -37,5 +37,5 @@ struct SkinData typedef QMap<QString, QImage> ButtonMaskImageMap; - QImage backgroundImage; + QPixmap backgroundPixmap; QImage buttonUpImage; QImage buttonDownImage; @@ -55,5 +55,5 @@ public: private: typedef QCache<SkinData> DataCache; - typedef QCache<QImage> BackgroundImageCache; + typedef QCache<QPixmap> BackgroundPixmapCache; template <class CacheType> @@ -61,5 +61,5 @@ private: DataCache m_cache; - BackgroundImageCache m_backgroundImageCache; + BackgroundPixmapCache m_backgroundPixmapCache; }; @@ -89,5 +89,5 @@ void Skin::init( const QString &name ) void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) { - backgroundImage(); + backgroundPixmap(); buttonUpImage(); buttonDownImage(); @@ -95,9 +95,9 @@ void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint butt } -QImage Skin::backgroundImage() const +QPixmap Skin::backgroundPixmap() const { - if ( d->backgroundImage.isNull() ) - d->backgroundImage = loadImage( QString( "%1/background" ).arg( m_skinPath ) ); - return d->backgroundImage; + if ( d->backgroundPixmap.isNull() ) + d->backgroundPixmap = loadImage( QString( "%1/background" ).arg( m_skinPath ) ); + return d->backgroundPixmap; } @@ -174,5 +174,5 @@ SkinCache::SkinCache() m_cache.setMaxCost( 2 ); // ... and one background pixmap - m_backgroundImageCache.setMaxCost( 1 ); + m_backgroundPixmapCache.setMaxCost( 1 ); } @@ -187,11 +187,11 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file qDebug( "SkinCache: hit" ); - QImage *bgImage = m_backgroundImageCache.find( skinPath ); - if ( bgImage ) { - qDebug( "SkinCache: hit on bgimage" ); - data->backgroundImage = *bgImage; + QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); + if ( bgPixmap ) { + qDebug( "SkinCache: hit on bgpixmap" ); + data->backgroundPixmap = *bgPixmap; } else - data->backgroundImage = QImage(); + data->backgroundPixmap = QPixmap(); return data; @@ -200,7 +200,7 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file void SkinCache::store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ) { - QImage *backgroundImage = new QImage( data->backgroundImage ); + QPixmap *backgroundPixmap = new QPixmap( data->backgroundPixmap ); - data->backgroundImage = QImage(); + data->backgroundPixmap = QPixmap(); QString key = skinPath + fileNameInfix; @@ -210,7 +210,7 @@ void SkinCache::store( const QString &skinPath, const QString &fileNameInfix, Sk delete data; - if ( m_backgroundImageCache.find( skinPath, false /*ref*/ ) != 0 || - !m_backgroundImageCache.insert( skinPath, backgroundImage ) ) - delete backgroundImage; + if ( m_backgroundPixmapCache.find( skinPath, false /*ref*/ ) != 0 || + !m_backgroundPixmapCache.insert( skinPath, backgroundPixmap ) ) + delete backgroundPixmap; } @@ -218,5 +218,5 @@ SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info ) : m_skin( info.skinName, info.fileNameInfix ), m_info( info ) { - m_currentState = LoadBackgroundImage; + m_currentState = LoadBackgroundPixmap; } @@ -224,7 +224,7 @@ SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadS { switch ( m_currentState ) { - case LoadBackgroundImage: - qDebug( "load bgimage" ); - m_skin.backgroundImage(); + case LoadBackgroundPixmap: + qDebug( "load bgpixmap" ); + m_skin.backgroundPixmap(); m_currentState = LoadButtonUpImage; break; diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h index a43a1d0..90062c2 100644 --- a/noncore/multimedia/opieplayer2/skin.h +++ b/noncore/multimedia/opieplayer2/skin.h @@ -41,5 +41,5 @@ public: void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); - QImage backgroundImage() const; + QPixmap backgroundPixmap() const; QImage buttonUpImage() const; QImage buttonDownImage() const; @@ -107,5 +107,5 @@ private: private: - enum State { LoadBackgroundImage, LoadButtonUpImage, LoadButtonDownImage, LoadButtonMasks, LoadButtonMask }; + enum State { LoadBackgroundPixmap, LoadButtonUpImage, LoadButtonDownImage, LoadButtonMasks, LoadButtonMask }; Skin m_skin; |