Lines Matching +refs:entry +refs:buffer
26 Entry(const void* buffer, size_t size, const SkBitmap& bm) in Entry()
32 memcpy(fBuffer, buffer, size); in Entry()
37 bool equals(const void* buffer, size_t size) const { in equals()
38 return (fSize == size) && !memcmp(fBuffer, buffer, size); in equals()
54 Entry* entry = fHead; in ~GrGradientBitmapCache() local
55 while (entry) { in ~GrGradientBitmapCache()
56 Entry* next = entry->fNext; in ~GrGradientBitmapCache()
57 delete entry; in ~GrGradientBitmapCache()
58 entry = next; in ~GrGradientBitmapCache()
62 GrGradientBitmapCache::Entry* GrGradientBitmapCache::release(Entry* entry) const { in release()
63 if (entry->fPrev) { in release()
64 SkASSERT(fHead != entry); in release()
65 entry->fPrev->fNext = entry->fNext; in release()
67 SkASSERT(fHead == entry); in release()
68 fHead = entry->fNext; in release()
70 if (entry->fNext) { in release()
71 SkASSERT(fTail != entry); in release()
72 entry->fNext->fPrev = entry->fPrev; in release()
74 SkASSERT(fTail == entry); in release()
75 fTail = entry->fPrev; in release()
77 return entry; in release()
80 void GrGradientBitmapCache::attachToHead(Entry* entry) const { in attachToHead()
81 entry->fPrev = nullptr; in attachToHead()
82 entry->fNext = fHead; in attachToHead()
84 fHead->fPrev = entry; in attachToHead()
86 fTail = entry; in attachToHead()
88 fHead = entry; in attachToHead()
91 bool GrGradientBitmapCache::find(const void* buffer, size_t size, SkBitmap* bm) const { in find() argument
94 Entry* entry = fHead; in find() local
95 while (entry) { in find()
96 if (entry->equals(buffer, size)) { in find()
98 *bm = entry->fBitmap; in find()
101 this->release(entry); in find()
102 this->attachToHead(entry); in find()
105 entry = entry->fNext; in find()
110 void GrGradientBitmapCache::add(const void* buffer, size_t len, const SkBitmap& bm) { in add() argument
119 Entry* entry = new Entry(buffer, len, bm); in add() local
120 this->attachToHead(entry); in add()
184 int32_t* buffer = storage.get(); in getGradient() local
186 *buffer++ = count; in getGradient()
187 memcpy(buffer, colors, count * sizeof(SkPMColor4f)); in getGradient()
188 buffer += colorsAsIntCount; in getGradient()
191 *buffer++ = SkFloat2Bits(positions[i]); in getGradient()
194 *buffer++ = static_cast<int32_t>(alphaType); in getGradient()
195 *buffer++ = static_cast<int32_t>(colorType); in getGradient()
196 SkASSERT(buffer - storage.get() == keyCount); in getGradient()
229 Entry* entry = fHead; in validate() local
231 while (entry) { in validate()
233 entry = entry->fNext; in validate()
237 entry = fTail; in validate()
238 while (entry) { in validate()
240 entry = entry->fPrev; in validate()