Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: src/gpu/GrGpuResourcePriv.h

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrLayerAtlas.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 SkBudgeted isBudgeted() const { 47 bool 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 SkBudgeted(ret); 50 return 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
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
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrLayerAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698