src/hbservers/hbthemeserver/hbicondatacache_p.h
changeset 3 11d3954df52a
parent 2 06ff229162e9
child 5 627c4a0fd0e7
equal deleted inserted replaced
2:06ff229162e9 3:11d3954df52a
    38     ~HbIconDataCache();
    38     ~HbIconDataCache();
    39     void clear();
    39     void clear();
    40     HbIconCacheItem* getCacheItem(const HbIconKey &key ,
    40     HbIconCacheItem* getCacheItem(const HbIconKey &key ,
    41                                   HbRenderingMode currentRenderingMode,
    41                                   HbRenderingMode currentRenderingMode,
    42                                   bool isMultiIconPiece = false);
    42                                   bool isMultiIconPiece = false);
    43     bool insert(const HbIconKey &key,  HbIconCacheItem* item);
    43     bool insert(const HbIconKey &key, HbIconCacheItem *item);
    44     bool remove(const HbIconKey&  key, bool keepInCache = true);
    44     bool remove(const HbIconKey&  key, bool keepInCache = true);
    45     void setMaxGpuCacheSize(int size);
    45     void setMaxGpuCacheSize(int size);
    46     void setMaxCpuCacheSize(int size);
    46     void setMaxCpuCacheSize(int size);
    47     bool contains(const HbIconKey &key) const;
    47     bool contains(const HbIconKey &key) const;
    48     HbIconCacheItem* value(const HbIconKey &key) const;
    48     HbIconCacheItem* value(const HbIconKey &key) const;
    49     bool isItemCachableInGpu(const HbIconCacheItem* item)const;
    49     bool isItemCachableInGpu(const HbIconCacheItem *item)const;
    50     bool isItemCachableInCpu(const HbIconCacheItem* item)const;
    50     bool isItemCachableInCpu(const HbIconCacheItem *item)const;
    51     void memoryGood();
    51     void memoryGood();
    52     void freeGpuRam(int bytes);
    52     void freeGpuRam(int bytes);
    53     void freeUnusedGpuResources();
    53     void freeUnusedGpuResources();
    54     QVector<const HbIconKey *> getKeys(const QString &filename) const;
    54     QVector<const HbIconKey *> getKeys(const QString &filename) const;
    55 
    55 
    76 
    76 
    77     void createGpuCacheSpace(int itemCost);
    77     void createGpuCacheSpace(int itemCost);
    78     void createCpuCacheSpace(int itemCost);
    78     void createCpuCacheSpace(int itemCost);
    79     void updateGpuLruSize(int iconDataCost);
    79     void updateGpuLruSize(int iconDataCost);
    80     void updateCpuLruSize(int iconDataCost);
    80     void updateCpuLruSize(int iconDataCost);
    81     void removeFromCache(const HbIconKey &key, const HbIconCacheItem* releaseItem);
    81     void removeFromCache(const HbIconKey &key, const HbIconCacheItem *releaseItem);
    82     void releaseVectorItem(HbIconCacheItem* releaseItem);
    82     void releaseVectorItem(HbIconCacheItem *releaseItem);
    83     void releaseRasterItem(HbIconCacheItem* releaseItem);
    83     void releaseRasterItem(HbIconCacheItem *releaseItem);
    84 
    84 
    85 private:
    85 private:
    86     QHash<HbIconKey, HbIconCacheItem*> *cache;
    86     QHash<HbIconKey, HbIconCacheItem*> *cache;
    87     HbDLinkList<HbIconCacheItem> gpuLruList;
    87     HbDLinkList<HbIconCacheItem> gpuLruList;
    88     HbDLinkList<HbIconCacheItem> cpuLruList;
    88     HbDLinkList<HbIconCacheItem> cpuLruList;