のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

Skia Gpu GrFontCache

     73 class GrFontCache {
     74 public:
     75     GrFontCache(GrGpu*);
     76     ~GrFontCache();
     77 
     78     inline GrTextStrike* getStrike(GrFontScaler*);
     79 
     80     void freeAll();
     81 
     82     void purgeExceptFor(GrTextStrike*);
     83 
     84     // testing
     85     int countStrikes() const { return fCache.getArray().count(); }
     86     const GrTextStrike* strikeAt(int index) const {
     87         return fCache.getArray()[index];
     88     }
     89     GrTextStrike* getHeadStrike() const { return fHead; }
     90 
     91 #if GR_DEBUG
     92     void validate() const;
     93 #else
     94     void validate() const {}
     95 #endif
     96 
     97 private:
     98     friend class GrFontPurgeListener;
     99 
    100     class Key;
    101     GrTHashTable<GrTextStrike, Key, 8> fCache;
    102     // for LRU
    103     GrTextStrike* fHead;
    104     GrTextStrike* fTail;
    105 
    106     GrGpu*      fGpu;
    107     GrAtlasMgr* fAtlasMgr;
    108 
    109 
    110     GrTextStrike* generateStrike(GrFontScaler*, const Key&);
    111     inline void detachStrikeFromList(GrTextStrike*);
    112 };
    113