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

Side by Side Diff: include/core/SkGraphics.h

Issue 24447003: add counting to glyphcache, and refactor some for clarity (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: expose count-limit in SkGraphics.h Created 7 years, 2 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
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkGlyphCache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SkGraphics_DEFINED 10 #ifndef SkGraphics_DEFINED
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 * had be called before the new limit was set. 47 * had be called before the new limit was set.
48 */ 48 */
49 static size_t SetFontCacheLimit(size_t bytes); 49 static size_t SetFontCacheLimit(size_t bytes);
50 50
51 /** 51 /**
52 * Return the number of bytes currently used by the font cache. 52 * Return the number of bytes currently used by the font cache.
53 */ 53 */
54 static size_t GetFontCacheUsed(); 54 static size_t GetFontCacheUsed();
55 55
56 /** 56 /**
57 * Return the number of entries in the font cache.
58 * A cache "entry" is associated with each typeface + pointSize + matrix.
59 */
60 static int GetFontCacheCountUsed();
61
62 /**
63 * Return the current limit to the number of entries in the font cache.
64 * A cache "entry" is associated with each typeface + pointSize + matrix.
65 */
66 static int GetFontCacheCountLimit();
67
68 /**
69 * Set the limit to the number of entries in the font cache, and return
70 * the previous value. If this new value is lower than the previous,
71 * it will automatically try to purge entries to meet the new limit.
72 */
73 static int SetFontCacheCountLimit(int count);
74
75 /**
57 * For debugging purposes, this will attempt to purge the font cache. It 76 * For debugging purposes, this will attempt to purge the font cache. It
58 * does not change the limit, but will cause subsequent font measures and 77 * does not change the limit, but will cause subsequent font measures and
59 * draws to be recreated, since they will no longer be in the cache. 78 * draws to be recreated, since they will no longer be in the cache.
60 */ 79 */
61 static void PurgeFontCache(); 80 static void PurgeFontCache();
62 81
63 static size_t GetImageCacheBytesUsed(); 82 static size_t GetImageCacheBytesUsed();
64 static size_t GetImageCacheByteLimit(); 83 static size_t GetImageCacheByteLimit();
65 static size_t SetImageCacheByteLimit(size_t newLimit); 84 static size_t SetImageCacheByteLimit(size_t newLimit);
66 85
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 public: 125 public:
107 SkAutoGraphics() { 126 SkAutoGraphics() {
108 SkGraphics::Init(); 127 SkGraphics::Init();
109 } 128 }
110 ~SkAutoGraphics() { 129 ~SkAutoGraphics() {
111 SkGraphics::Term(); 130 SkGraphics::Term();
112 } 131 }
113 }; 132 };
114 133
115 #endif 134 #endif
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkGlyphCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698