| Index: src/gpu/GrTextBlobCache.h
|
| diff --git a/src/gpu/GrTextBlobCache.h b/src/gpu/GrTextBlobCache.h
|
| index 9e1e26f7e6d7a5341e699af3b5389fcb9dc12f23..a1f73918e741f4b78b4cb05f911f668d92ec577b 100644
|
| --- a/src/gpu/GrTextBlobCache.h
|
| +++ b/src/gpu/GrTextBlobCache.h
|
| @@ -29,22 +29,24 @@ public:
|
| return cacheBlob;
|
| }
|
|
|
| - BitmapTextBlob* createCachedBlob(const SkTextBlob* blob, size_t maxVAStride) {
|
| + BitmapTextBlob* createCachedBlob(const SkTextBlob* blob,
|
| + BitmapTextBlob::Key& key,
|
| + size_t maxVAStride) {
|
| int glyphCount = 0;
|
| int runCount = 0;
|
| BlobGlyphCount(&glyphCount, &runCount, blob);
|
| BitmapTextBlob* cacheBlob = this->createBlob(glyphCount, runCount, maxVAStride);
|
| - cacheBlob->fUniqueID = blob->uniqueID();
|
| + cacheBlob->fKey = key;
|
| this->add(cacheBlob);
|
| return cacheBlob;
|
| }
|
|
|
| - BitmapTextBlob* find(uint32_t uniqueID) {
|
| - return fCache.find(uniqueID);
|
| + BitmapTextBlob* find(const BitmapTextBlob::Key& key) {
|
| + return fCache.find(key);
|
| }
|
|
|
| void remove(BitmapTextBlob* blob) {
|
| - fCache.remove(blob->fUniqueID);
|
| + fCache.remove(blob->fKey);
|
| fBlobList.remove(blob);
|
| blob->unref();
|
| }
|
| @@ -60,7 +62,7 @@ public:
|
| BitmapTextBlob* lruBlob = iter.get();
|
| SkASSERT(lruBlob);
|
| do {
|
| - fCache.remove(lruBlob->fUniqueID);
|
| + fCache.remove(lruBlob->fKey);
|
| fBlobList.remove(lruBlob);
|
| lruBlob->unref();
|
| iter.prev();
|
| @@ -88,7 +90,7 @@ private:
|
|
|
| typedef SkTInternalLList<BitmapTextBlob> BitmapBlobList;
|
| BitmapBlobList fBlobList;
|
| - SkTDynamicHash<BitmapTextBlob, uint32_t> fCache;
|
| + SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key> fCache;
|
| GrMemoryPool fPool;
|
| size_t fBudget;
|
| };
|
|
|