Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: src/core/SkGlyphCache.h

Issue 24447003: add counting to glyphcache, and refactor some for clarity (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkGlyphCache.cpp » ('j') | src/core/SkGlyphCache.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698