OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrTextBlobCache.h" | 8 #include "GrTextBlobCache.h" |
9 | 9 |
10 static const int kVerticesPerGlyph = 4; | 10 static const int kVerticesPerGlyph = 4; |
(...skipping 24 matching lines...) Expand all Loading... |
35 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run); | 35 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run); |
36 } | 36 } |
37 cacheBlob->fRunCount = runCount; | 37 cacheBlob->fRunCount = runCount; |
38 cacheBlob->fPool = &fPool; | 38 cacheBlob->fPool = &fPool; |
39 return cacheBlob; | 39 return cacheBlob; |
40 } | 40 } |
41 | 41 |
42 void GrTextBlobCache::freeAll() { | 42 void GrTextBlobCache::freeAll() { |
43 SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache); | 43 SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache); |
44 while (!iter.done()) { | 44 while (!iter.done()) { |
45 (&(*iter))->unref(); | 45 BitmapTextBlob* blob = &(*iter); |
| 46 fBlobList.remove(blob); |
| 47 blob->unref(); |
46 ++iter; | 48 ++iter; |
47 } | 49 } |
48 fCache.rewind(); | 50 fCache.rewind(); |
49 } | 51 } |
OLD | NEW |