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

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

Issue 1810323002: Cache render targets that render to wrapped textures 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
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 SkBudgeted isBudgeted() const { return fResource->fBudgeted; }
48 bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle;
49 SkASSERT(ret || !fResource->getUniqueKey().isValid());
50 return SkBudgeted(ret);
51 }
52 48
53 /** 49 /**
54 * Is the resource object wrapping an externally allocated GPU resource? 50 * Is the resource object wrapping an externally allocated GPU resource?
55 */ 51 */
56 bool isExternal() const { return fResource->isExternal(); } 52 bool refsWrappedResources() const { return fResource->refsWrappedResources() ; }
57 53
58 /** 54 /**
59 * If this resource can be used as a scratch resource this returns a valid s cratch key. 55 * If this resource can be used as a scratch resource this returns a valid s cratch key.
60 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be 56 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be
61 * used as a uniquely keyed resource rather than scratch. Check isScratch(). 57 * used as a uniquely keyed resource rather than scratch. Check isScratch().
62 */ 58 */
63 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } 59 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; }
64 60
65 /** 61 /**
66 * If the resource has a scratch key, the key will be removed. Since scratch keys are installed 62 * If the resource has a scratch key, the key will be removed. Since scratch keys are installed
(...skipping 15 matching lines...) Expand all
82 friend class GrGpuResource; // to construct/copy this type. 78 friend class GrGpuResource; // to construct/copy this type.
83 }; 79 };
84 80
85 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour cePriv(this); } 81 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour cePriv(this); }
86 82
87 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { 83 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const {
88 return ResourcePriv(const_cast<GrGpuResource*>(this)); 84 return ResourcePriv(const_cast<GrGpuResource*>(this));
89 } 85 }
90 86
91 #endif 87 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrPath.h » ('j') | src/gpu/gl/GrGLGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698