OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkResourceCache_DEFINED | 8 #ifndef SkResourceCache_DEFINED |
9 #define SkResourceCache_DEFINED | 9 #define SkResourceCache_DEFINED |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 * Returns the DiscardableFactory used by the global cache, or NULL. | 128 * Returns the DiscardableFactory used by the global cache, or NULL. |
129 */ | 129 */ |
130 static DiscardableFactory GetDiscardableFactory(); | 130 static DiscardableFactory GetDiscardableFactory(); |
131 | 131 |
132 /** | 132 /** |
133 * Use this allocator for bitmaps, so they can use ashmem when available. | 133 * Use this allocator for bitmaps, so they can use ashmem when available. |
134 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. | 134 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. |
135 */ | 135 */ |
136 static SkBitmap::Allocator* GetAllocator(); | 136 static SkBitmap::Allocator* GetAllocator(); |
137 | 137 |
| 138 static SkCachedData* NewCachedData(size_t bytes); |
| 139 |
138 /** | 140 /** |
139 * Call SkDebugf() with diagnostic information about the state of the cache | 141 * Call SkDebugf() with diagnostic information about the state of the cache |
140 */ | 142 */ |
141 static void Dump(); | 143 static void Dump(); |
142 | 144 |
143 /////////////////////////////////////////////////////////////////////////// | 145 /////////////////////////////////////////////////////////////////////////// |
144 | 146 |
145 /** | 147 /** |
146 * Construct the cache to call DiscardableFactory when it | 148 * Construct the cache to call DiscardableFactory when it |
147 * allocates memory for the pixels. In this mode, the cache has | 149 * allocates memory for the pixels. In this mode, the cache has |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 231 |
230 void init(); // called by constructors | 232 void init(); // called by constructors |
231 | 233 |
232 #ifdef SK_DEBUG | 234 #ifdef SK_DEBUG |
233 void validate() const; | 235 void validate() const; |
234 #else | 236 #else |
235 void validate() const {} | 237 void validate() const {} |
236 #endif | 238 #endif |
237 }; | 239 }; |
238 #endif | 240 #endif |
OLD | NEW |