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 SkGraphics_DEFINED | 10 #ifndef SkGraphics_DEFINED |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 /** | 91 /** |
92 * These functions get/set the memory usage limit for the resource cache, u
sed for temporary | 92 * These functions get/set the memory usage limit for the resource cache, u
sed for temporary |
93 * bitmaps and other resources. Entries are purged from the cache when the
memory useage | 93 * bitmaps and other resources. Entries are purged from the cache when the
memory useage |
94 * exceeds this limit. | 94 * exceeds this limit. |
95 */ | 95 */ |
96 static size_t GetResourceCacheTotalByteLimit(); | 96 static size_t GetResourceCacheTotalByteLimit(); |
97 static size_t SetResourceCacheTotalByteLimit(size_t newLimit); | 97 static size_t SetResourceCacheTotalByteLimit(size_t newLimit); |
98 | 98 |
99 /** | 99 /** |
| 100 * For debugging purposes, this will attempt to purge the resource cache. I
t |
| 101 * does not change the limit. |
| 102 */ |
| 103 static void PurgeResourceCache(); |
| 104 |
| 105 /** |
100 * When the cachable entry is very lage (e.g. a large scaled bitmap), addin
g it to the cache | 106 * When the cachable entry is very lage (e.g. a large scaled bitmap), addin
g it to the cache |
101 * can cause most/all of the existing entries to be purged. To avoid the, t
he client can set | 107 * can cause most/all of the existing entries to be purged. To avoid the, t
he client can set |
102 * a limit for a single allocation. If a cacheable entry would have been ca
ched, but its size | 108 * a limit for a single allocation. If a cacheable entry would have been ca
ched, but its size |
103 * exceeds this limit, then we do not attempt to cache it at all. | 109 * exceeds this limit, then we do not attempt to cache it at all. |
104 * | 110 * |
105 * Zero is the default value, meaning we always attempt to cache entries. | 111 * Zero is the default value, meaning we always attempt to cache entries. |
106 */ | 112 */ |
107 static size_t GetResourceCacheSingleAllocationByteLimit(); | 113 static size_t GetResourceCacheSingleAllocationByteLimit(); |
108 static size_t SetResourceCacheSingleAllocationByteLimit(size_t newLimit); | 114 static size_t SetResourceCacheSingleAllocationByteLimit(size_t newLimit); |
109 | 115 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 public: | 182 public: |
177 SkAutoGraphics() { | 183 SkAutoGraphics() { |
178 SkGraphics::Init(); | 184 SkGraphics::Init(); |
179 } | 185 } |
180 ~SkAutoGraphics() { | 186 ~SkAutoGraphics() { |
181 SkGraphics::Term(); | 187 SkGraphics::Term(); |
182 } | 188 } |
183 }; | 189 }; |
184 | 190 |
185 #endif | 191 #endif |
OLD | NEW |