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

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

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix unrelated GrBuffer::onGpuMemorySize() lack of override keyword compile error Created 4 years, 8 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/GrPath.h » ('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 * 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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698