| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrGpuResourcePriv_DEFINED | 9 #ifndef GrGpuResourcePriv_DEFINED |
| 10 #define GrGpuResourcePriv_DEFINED | 10 #define GrGpuResourcePriv_DEFINED |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * If the resource is cached make it uncached. Has no effect on resources th
at are wrapped or | 39 * If the resource is cached make it uncached. Has no effect on resources th
at are wrapped or |
| 40 * already uncached. Furthermore, resources with unique keys cannot be made
unbudgeted. | 40 * already uncached. Furthermore, resources with unique keys cannot be made
unbudgeted. |
| 41 */ | 41 */ |
| 42 void makeUnbudgeted() { fResource->makeUnbudgeted(); } | 42 void makeUnbudgeted() { fResource->makeUnbudgeted(); } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Does the resource count against the resource budget? | 45 * Does the resource count against the resource budget? |
| 46 */ | 46 */ |
| 47 bool isBudgeted() const { | 47 SkBudgeted isBudgeted() const { |
| 48 bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; | 48 bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; |
| 49 SkASSERT(ret || !fResource->getUniqueKey().isValid()); | 49 SkASSERT(ret || !fResource->getUniqueKey().isValid()); |
| 50 return ret; | 50 return SkBudgeted(ret); |
| 51 } | 51 } |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * If this resource can be used as a scratch resource this returns a valid s
cratch key. | 54 * If this resource can be used as a scratch resource this returns a valid s
cratch key. |
| 55 * Otherwise it returns a key for which isNullScratch is true. The resource
may currently be | 55 * Otherwise it returns a key for which isNullScratch is true. The resource
may currently be |
| 56 * used as a uniquely keyed resource rather than scratch. Check isScratch(). | 56 * used as a uniquely keyed resource rather than scratch. Check isScratch(). |
| 57 */ | 57 */ |
| 58 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } | 58 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } |
| 59 | 59 |
| 60 /** | 60 /** |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 friend class GrGpuResource; // to construct/copy this type. | 77 friend class GrGpuResource; // to construct/copy this type. |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour
cePriv(this); } | 80 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour
cePriv(this); } |
| 81 | 81 |
| 82 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { | 82 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { |
| 83 return ResourcePriv(const_cast<GrGpuResource*>(this)); | 83 return ResourcePriv(const_cast<GrGpuResource*>(this)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 #endif | 86 #endif |
| OLD | NEW |