| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2015 Google Inc. | 2  * Copyright 2015 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 GrGpuResourcePriv_DEFINED | 8 #ifndef GrGpuResourcePriv_DEFINED | 
| 9 #define GrGpuResourcePriv_DEFINED | 9 #define GrGpuResourcePriv_DEFINED | 
| 10 | 10 | 
| (...skipping 26 matching lines...) Expand all  Loading... | 
| 37     /** | 37     /** | 
| 38      * If the resource is cached make it uncached. Has no effect on resources th
    at are wrapped or | 38      * If the resource is cached make it uncached. Has no effect on resources th
    at are wrapped or | 
| 39      * already uncached. Furthermore, resources with unique keys cannot be made 
    unbudgeted. | 39      * already uncached. Furthermore, resources with unique keys cannot be made 
    unbudgeted. | 
| 40      */ | 40      */ | 
| 41     void makeUnbudgeted() { fResource->makeUnbudgeted(); } | 41     void makeUnbudgeted() { fResource->makeUnbudgeted(); } | 
| 42 | 42 | 
| 43     /** | 43     /** | 
| 44      * Does the resource count against the resource budget? | 44      * Does the resource count against the resource budget? | 
| 45      */ | 45      */ | 
| 46     SkBudgeted isBudgeted() const { | 46     SkBudgeted isBudgeted() const { | 
| 47         bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; | 47         bool ret = SkBudgeted::kYes == fResource->fBudgeted; | 
| 48         SkASSERT(ret || !fResource->getUniqueKey().isValid()); | 48         SkASSERT(ret || !fResource->getUniqueKey().isValid()); | 
| 49         return SkBudgeted(ret); | 49         return SkBudgeted(ret); | 
| 50     } | 50     } | 
| 51 | 51 | 
| 52     /** | 52     /** | 
| 53      * Is the resource object wrapping an externally allocated GPU resource? | 53      * Is the resource object wrapping an externally allocated GPU resource? | 
| 54      */ | 54      */ | 
| 55     bool isExternal() const { return fResource->isExternal(); } | 55     bool refsWrappedObjects() const { return fResource->fRefsWrappedObjects; } | 
| 56 | 56 | 
| 57     /** | 57     /** | 
| 58      * If this resource can be used as a scratch resource this returns a valid s
    cratch key. | 58      * If this resource can be used as a scratch resource this returns a valid s
    cratch key. | 
| 59      * Otherwise it returns a key for which isNullScratch is true. The resource 
    may currently be | 59      * Otherwise it returns a key for which isNullScratch is true. The resource 
    may currently be | 
| 60      * used as a uniquely keyed resource rather than scratch. Check isScratch(). | 60      * used as a uniquely keyed resource rather than scratch. Check isScratch(). | 
| 61      */ | 61      */ | 
| 62     const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } | 62     const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } | 
| 63 | 63 | 
| 64     /** | 64     /** | 
| 65      * If the resource has a scratch key, the key will be removed. Since scratch
     keys are installed | 65      * If the resource has a scratch key, the key will be removed. Since scratch
     keys are installed | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 81     friend class GrGpuResource; // to construct/copy this type. | 81     friend class GrGpuResource; // to construct/copy this type. | 
| 82 }; | 82 }; | 
| 83 | 83 | 
| 84 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour
    cePriv(this); } | 84 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour
    cePriv(this); } | 
| 85 | 85 | 
| 86 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { | 86 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { | 
| 87     return ResourcePriv(const_cast<GrGpuResource*>(this)); | 87     return ResourcePriv(const_cast<GrGpuResource*>(this)); | 
| 88 } | 88 } | 
| 89 | 89 | 
| 90 #endif | 90 #endif | 
| OLD | NEW | 
|---|