Chromium Code Reviews| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 void removeUniqueKey(); | 272 void removeUniqueKey(); |
| 273 void notifyAllCntsAreZero(CntType) const; | 273 void notifyAllCntsAreZero(CntType) const; |
| 274 bool notifyRefCountIsZero() const; | 274 bool notifyRefCountIsZero() const; |
| 275 void removeScratchKey(); | 275 void removeScratchKey(); |
| 276 void makeBudgeted(); | 276 void makeBudgeted(); |
| 277 void makeUnbudgeted(); | 277 void makeUnbudgeted(); |
| 278 | 278 |
| 279 #ifdef SK_DEBUG | 279 #ifdef SK_DEBUG |
| 280 friend class GrGpu; // for assert in GrGpu to access getGpu | 280 friend class GrGpu; // for assert in GrGpu to access getGpu |
| 281 #endif | 281 #endif |
| 282 friend class GrSurfaceProxy; // for access to CreateUniqueID | |
|
bsalomon
2016/08/31 17:53:18
Is there a lighter weight way we could do this? I
robertphillips
2016/08/31 19:11:38
Done. Made it public.
| |
| 282 | 283 |
| 283 static uint32_t CreateUniqueID(); | 284 static uint32_t CreateUniqueID(); |
| 284 | 285 |
| 285 // An index into a heap when this resource is purgeable or an array when not . This is maintained | 286 // An index into a heap when this resource is purgeable or an array when not . This is maintained |
| 286 // by the cache. | 287 // by the cache. |
| 287 int fCacheArrayIndex; | 288 int fCacheArrayIndex; |
| 288 // This value reflects how recently this resource was accessed in the cache. This is maintained | 289 // This value reflects how recently this resource was accessed in the cache. This is maintained |
| 289 // by the cache. | 290 // by the cache. |
| 290 uint32_t fTimestamp; | 291 uint32_t fTimestamp; |
| 291 | 292 |
| 292 static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0); | 293 static const size_t kInvalidGpuMemorySize = ~static_cast<size_t>(0); |
| 293 GrScratchKey fScratchKey; | 294 GrScratchKey fScratchKey; |
| 294 GrUniqueKey fUniqueKey; | 295 GrUniqueKey fUniqueKey; |
| 295 | 296 |
| 296 // This is not ref'ed but abandon() or release() will be called before the G rGpu object | 297 // This is not ref'ed but abandon() or release() will be called before the G rGpu object |
| 297 // is destroyed. Those calls set will this to NULL. | 298 // is destroyed. Those calls set will this to NULL. |
| 298 GrGpu* fGpu; | 299 GrGpu* fGpu; |
| 299 mutable size_t fGpuMemorySize; | 300 mutable size_t fGpuMemorySize; |
| 300 | 301 |
| 301 SkBudgeted fBudgeted; | 302 SkBudgeted fBudgeted; |
| 302 bool fRefsWrappedObjects; | 303 bool fRefsWrappedObjects; |
| 303 const uint32_t fUniqueID; | 304 const uint32_t fUniqueID; |
| 304 | 305 |
| 305 typedef GrIORef<GrGpuResource> INHERITED; | 306 typedef GrIORef<GrGpuResource> INHERITED; |
| 306 friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and n otifyRefCntIsZero. | 307 friend class GrIORef<GrGpuResource>; // to access notifyAllCntsAreZero and n otifyRefCntIsZero. |
| 307 }; | 308 }; |
| 308 | 309 |
| 309 #endif | 310 #endif |
| OLD | NEW |