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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 private: | 257 private: |
258 /** | 258 /** |
259 * Frees the object in the underlying 3D API. Called by CacheAccess. | 259 * Frees the object in the underlying 3D API. Called by CacheAccess. |
260 */ | 260 */ |
261 void release(); | 261 void release(); |
262 | 262 |
263 virtual size_t onGpuMemorySize() const = 0; | 263 virtual size_t onGpuMemorySize() const = 0; |
264 | 264 |
265 // See comments in CacheAccess. | 265 // See comments in CacheAccess. |
266 bool setContentKey(const GrContentKey& contentKey); | 266 bool setContentKey(const GrContentKey& contentKey); |
| 267 void removeContentKey(); |
267 void notifyIsPurgeable() const; | 268 void notifyIsPurgeable() const; |
268 void removeScratchKey(); | 269 void removeScratchKey(); |
269 void makeBudgeted(); | 270 void makeBudgeted(); |
270 void makeUnbudgeted(); | 271 void makeUnbudgeted(); |
271 | 272 |
272 #ifdef SK_DEBUG | 273 #ifdef SK_DEBUG |
273 friend class GrGpu; // for assert in GrGpu to access getGpu | 274 friend class GrGpu; // for assert in GrGpu to access getGpu |
274 #endif | 275 #endif |
275 | 276 |
276 static uint32_t CreateUniqueID(); | 277 static uint32_t CreateUniqueID(); |
(...skipping 14 matching lines...) Expand all Loading... |
291 LifeCycle fLifeCycle; | 292 LifeCycle fLifeCycle; |
292 const uint32_t fUniqueID; | 293 const uint32_t fUniqueID; |
293 | 294 |
294 SkAutoTUnref<const SkData> fData; | 295 SkAutoTUnref<const SkData> fData; |
295 | 296 |
296 typedef GrIORef<GrGpuResource> INHERITED; | 297 typedef GrIORef<GrGpuResource> INHERITED; |
297 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgeable. | 298 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgeable. |
298 }; | 299 }; |
299 | 300 |
300 #endif | 301 #endif |
OLD | NEW |