src/hbservers/hbthemeserver/hbicondatacache_p.h
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    38     ~HbIconDataCache();
    38     ~HbIconDataCache();
    39     void clear();
    39     void clear();
    40     HbIconCacheItem* getCacheItem(const HbIconKey &key ,
    40     HbIconCacheItem* getCacheItem(const HbIconKey &key ,
    41                                   bool isMultiIconPiece = false);
    41                                   bool isMultiIconPiece = false);
    42     bool insert(const HbIconKey &key,  HbIconCacheItem* item);
    42     bool insert(const HbIconKey &key,  HbIconCacheItem* item);
    43     bool remove(const HbIconKey&  key);
    43     bool remove(const HbIconKey&  key, bool keepInCache = true);
    44     void setMaxGpuCacheSize(int size);
    44     void setMaxGpuCacheSize(int size);
    45     void setMaxCpuCacheSize(int size);
    45     void setMaxCpuCacheSize(int size);
    46     bool contains(const HbIconKey &key) const;
    46     bool contains(const HbIconKey &key) const;
    47     HbIconCacheItem* value(const HbIconKey &key) const;
    47     HbIconCacheItem* value(const HbIconKey &key) const;
    48     bool isItemCachableInGpu(const HbIconCacheItem* item)const;
    48     bool isItemCachableInGpu(const HbIconCacheItem* item)const;
    49     bool isItemCachableInCpu(const HbIconCacheItem* item)const;
    49     bool isItemCachableInCpu(const HbIconCacheItem* item)const;
    50     void memoryGood();
    50     void memoryGood();
    51     void freeGpuRam(int bytes);
    51     void freeGpuRam(int bytes);
       
    52     QVector<const HbIconKey *> getKeys(const QString &filename) const;
    52 
    53 
    53 //Debug Code for Test Purpose
    54 //Debug Code for Test Purpose
    54 #ifdef HB_ICON_CACHE_DEBUG
    55 #ifdef HB_ICON_CACHE_DEBUG
    55     void cleanVectorLRUList();
    56     void cleanVectorLRUList();
    56     void cleanRasterLRUList();
    57     void cleanRasterLRUList();
    73 
    74 
    74     void createGpuCacheSpace(int itemCost);
    75     void createGpuCacheSpace(int itemCost);
    75     void createCpuCacheSpace(int itemCost);
    76     void createCpuCacheSpace(int itemCost);
    76     void updateGpuLruSize(int iconDataCost);
    77     void updateGpuLruSize(int iconDataCost);
    77     void updateCpuLruSize(int iconDataCost);
    78     void updateCpuLruSize(int iconDataCost);
    78     //Debug Code for Test Purpose
       
    79 #ifdef HB_ICON_CACHE_DEBUG
       
    80     void removeFromCache(const HbIconKey &key, const HbIconCacheItem* releaseItem);
    79     void removeFromCache(const HbIconKey &key, const HbIconCacheItem* releaseItem);
    81     void releaseVectorItem(HbIconCacheItem* releaseItem);
    80     void releaseVectorItem(HbIconCacheItem* releaseItem);
    82     void releaseRasterItem(HbIconCacheItem* releaseItem);
    81     void releaseRasterItem(HbIconCacheItem* releaseItem);
    83 #endif
       
    84 
    82 
    85 private:
    83 private:
    86     QHash<HbIconKey, HbIconCacheItem*> *cache;
    84     QHash<HbIconKey, HbIconCacheItem*> *cache;
    87     HbDLinkList<HbIconCacheItem> gpuLruList;
    85     HbDLinkList<HbIconCacheItem> gpuLruList;
    88     HbDLinkList<HbIconCacheItem> cpuLruList;
    86     HbDLinkList<HbIconCacheItem> cpuLruList;