OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGpuResource_DEFINED | 8 #ifndef GrGpuResource_DEFINED |
9 #define GrGpuResource_DEFINED | 9 #define GrGpuResource_DEFINED |
10 | 10 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 * Frees the object in the underlying 3D API. Called by CacheAccess. | 255 * Frees the object in the underlying 3D API. Called by CacheAccess. |
256 */ | 256 */ |
257 void release(); | 257 void release(); |
258 | 258 |
259 virtual size_t onGpuMemorySize() const = 0; | 259 virtual size_t onGpuMemorySize() const = 0; |
260 | 260 |
261 // See comments in CacheAccess. | 261 // See comments in CacheAccess. |
262 bool setContentKey(const GrResourceKey& contentKey); | 262 bool setContentKey(const GrResourceKey& contentKey); |
263 void notifyIsPurgable() const; | 263 void notifyIsPurgable() const; |
264 void removeScratchKey(); | 264 void removeScratchKey(); |
| 265 void makeBudgeted(); |
265 | 266 |
266 #ifdef SK_DEBUG | 267 #ifdef SK_DEBUG |
267 friend class GrGpu; // for assert in GrGpu to access getGpu | 268 friend class GrGpu; // for assert in GrGpu to access getGpu |
268 #endif | 269 #endif |
269 | 270 |
270 static uint32_t CreateUniqueID(); | 271 static uint32_t CreateUniqueID(); |
271 | 272 |
272 // We're in an internal doubly linked list owned by GrResourceCache2 | 273 // We're in an internal doubly linked list owned by GrResourceCache2 |
273 SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuResource); | 274 SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrGpuResource); |
274 | 275 |
(...skipping 19 matching lines...) Expand all Loading... |
294 LifeCycle fLifeCycle; | 295 LifeCycle fLifeCycle; |
295 const uint32_t fUniqueID; | 296 const uint32_t fUniqueID; |
296 | 297 |
297 SkAutoTUnref<const SkData> fData; | 298 SkAutoTUnref<const SkData> fData; |
298 | 299 |
299 typedef GrIORef<GrGpuResource> INHERITED; | 300 typedef GrIORef<GrGpuResource> INHERITED; |
300 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable. | 301 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable. |
301 }; | 302 }; |
302 | 303 |
303 #endif | 304 #endif |
OLD | NEW |