| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkGlyphCache_DEFINED | 10 #ifndef SkGlyphCache_DEFINED |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 size_t fMemoryUsed; | 251 size_t fMemoryUsed; |
| 252 | 252 |
| 253 struct AuxProcRec { | 253 struct AuxProcRec { |
| 254 AuxProcRec* fNext; | 254 AuxProcRec* fNext; |
| 255 void (*fProc)(void*); | 255 void (*fProc)(void*); |
| 256 void* fData; | 256 void* fData; |
| 257 }; | 257 }; |
| 258 AuxProcRec* fAuxProcList; | 258 AuxProcRec* fAuxProcList; |
| 259 void invokeAndRemoveAuxProcs(); | 259 void invokeAndRemoveAuxProcs(); |
| 260 | 260 |
| 261 // This relies on the caller to have already acquired the mutex to access th
e global cache | |
| 262 static size_t InternalFreeCache(SkGlyphCache_Globals*, size_t bytesNeeded); | |
| 263 | |
| 264 inline static SkGlyphCache* FindTail(SkGlyphCache* head); | 261 inline static SkGlyphCache* FindTail(SkGlyphCache* head); |
| 265 | 262 |
| 266 friend class SkGlyphCache_Globals; | 263 friend class SkGlyphCache_Globals; |
| 267 }; | 264 }; |
| 268 | 265 |
| 269 class SkAutoGlyphCache { | 266 class SkAutoGlyphCache { |
| 270 public: | 267 public: |
| 271 SkAutoGlyphCache(SkGlyphCache* cache) : fCache(cache) {} | 268 SkAutoGlyphCache(SkGlyphCache* cache) : fCache(cache) {} |
| 272 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc) { | 269 SkAutoGlyphCache(SkTypeface* typeface, const SkDescriptor* desc) { |
| 273 fCache = SkGlyphCache::DetachCache(typeface, desc); | 270 fCache = SkGlyphCache::DetachCache(typeface, desc); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 292 } | 289 } |
| 293 } | 290 } |
| 294 | 291 |
| 295 private: | 292 private: |
| 296 SkGlyphCache* fCache; | 293 SkGlyphCache* fCache; |
| 297 | 294 |
| 298 static bool DetachProc(const SkGlyphCache*, void*); | 295 static bool DetachProc(const SkGlyphCache*, void*); |
| 299 }; | 296 }; |
| 300 | 297 |
| 301 #endif | 298 #endif |
| OLD | NEW |