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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 * 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 |
107 * 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 |
108 * 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 |
109 * 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. |
110 * | 110 * |
111 * 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. |
112 */ | 112 */ |
113 static size_t GetResourceCacheSingleAllocationByteLimit(); | 113 static size_t GetResourceCacheSingleAllocationByteLimit(); |
114 static size_t SetResourceCacheSingleAllocationByteLimit(size_t newLimit); | 114 static size_t SetResourceCacheSingleAllocationByteLimit(size_t newLimit); |
115 | 115 |
116 #ifdef SK_SUPPORT_LEGACY_IMAGECACHE_NAME | |
117 static size_t GetImageCacheBytesUsed() { | |
118 return GetImageCacheTotalBytesUsed(); | |
119 } | |
120 static size_t GetImageCacheByteLimit() { | |
121 return GetImageCacheTotalByteLimit(); | |
122 } | |
123 static size_t SetImageCacheByteLimit(size_t newLimit) { | |
124 return SetImageCacheTotalByteLimit(newLimit); | |
125 } | |
126 static size_t GetImageCacheTotalBytesUsed() { | |
127 return GetResourceCacheTotalBytesUsed(); | |
128 } | |
129 static size_t GetImageCacheTotalByteLimit() { | |
130 return GetResourceCacheTotalByteLimit(); | |
131 } | |
132 static size_t SetImageCacheTotalByteLimit(size_t newLimit) { | |
133 return SetResourceCacheTotalByteLimit(newLimit); | |
134 } | |
135 static size_t GetImageCacheSingleAllocationByteLimit() { | |
136 return GetResourceCacheSingleAllocationByteLimit(); | |
137 } | |
138 static size_t SetImageCacheSingleAllocationByteLimit(size_t newLimit) { | |
139 return SetResourceCacheSingleAllocationByteLimit(newLimit); | |
140 } | |
141 #endif | |
142 | |
143 /** | 116 /** |
144 * Applications with command line options may pass optional state, such | 117 * Applications with command line options may pass optional state, such |
145 * as cache sizes, here, for instance: | 118 * as cache sizes, here, for instance: |
146 * font-cache-limit=12345678 | 119 * font-cache-limit=12345678 |
147 * | 120 * |
148 * The flags format is name=value[;name=value...] with no spaces. | 121 * The flags format is name=value[;name=value...] with no spaces. |
149 * This format is subject to change. | 122 * This format is subject to change. |
150 */ | 123 */ |
151 static void SetFlags(const char* flags); | 124 static void SetFlags(const char* flags); |
152 | 125 |
(...skipping 29 matching lines...) Expand all Loading... |
182 public: | 155 public: |
183 SkAutoGraphics() { | 156 SkAutoGraphics() { |
184 SkGraphics::Init(); | 157 SkGraphics::Init(); |
185 } | 158 } |
186 ~SkAutoGraphics() { | 159 ~SkAutoGraphics() { |
187 SkGraphics::Term(); | 160 SkGraphics::Term(); |
188 } | 161 } |
189 }; | 162 }; |
190 | 163 |
191 #endif | 164 #endif |
OLD | NEW |