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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 * Returns the DiscardableFactory used by the global cache, or NULL. | 130 * Returns the DiscardableFactory used by the global cache, or NULL. |
131 */ | 131 */ |
132 static DiscardableFactory GetDiscardableFactory(); | 132 static DiscardableFactory GetDiscardableFactory(); |
133 | 133 |
134 /** | 134 /** |
135 * Use this allocator for bitmaps, so they can use ashmem when available. | 135 * Use this allocator for bitmaps, so they can use ashmem when available. |
136 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. | 136 * Returns NULL if the ResourceCache has not been initialized with a Discard
ableFactory. |
137 */ | 137 */ |
138 static SkBitmap::Allocator* GetAllocator(); | 138 static SkBitmap::Allocator* GetAllocator(); |
139 | 139 |
| 140 static SkCachedData* NewCachedData(size_t bytes); |
| 141 |
140 /** | 142 /** |
141 * Call SkDebugf() with diagnostic information about the state of the cache | 143 * Call SkDebugf() with diagnostic information about the state of the cache |
142 */ | 144 */ |
143 static void Dump(); | 145 static void Dump(); |
144 | 146 |
145 /////////////////////////////////////////////////////////////////////////// | 147 /////////////////////////////////////////////////////////////////////////// |
146 | 148 |
147 /** | 149 /** |
148 * Construct the cache to call DiscardableFactory when it | 150 * Construct the cache to call DiscardableFactory when it |
149 * allocates memory for the pixels. In this mode, the cache has | 151 * allocates memory for the pixels. In this mode, the cache has |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 233 |
232 void init(); // called by constructors | 234 void init(); // called by constructors |
233 | 235 |
234 #ifdef SK_DEBUG | 236 #ifdef SK_DEBUG |
235 void validate() const; | 237 void validate() const; |
236 #else | 238 #else |
237 void validate() const {} | 239 void validate() const {} |
238 #endif | 240 #endif |
239 }; | 241 }; |
240 #endif | 242 #endif |
OLD | NEW |