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

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

Issue 747043004: Use scratch keys for stencil buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 years 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/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 GrGpuResourceCacheAccess_DEFINED 9 #ifndef GrGpuResourceCacheAccess_DEFINED
10 #define GrGpuResourceCacheAccess_DEFINED 10 #define GrGpuResourceCacheAccess_DEFINED
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 /** 45 /**
46 * If this resource can be used as a scratch resource this returns a valid s cratch key. 46 * If this resource can be used as a scratch resource this returns a valid s cratch key.
47 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be 47 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be
48 * used as content resource rather than scratch. Check isScratch(). 48 * used as content resource rather than scratch. Check isScratch().
49 */ 49 */
50 const GrResourceKey& getScratchKey() const { return fResource->fScratchKey; } 50 const GrResourceKey& getScratchKey() const { return fResource->fScratchKey; }
51 51
52 /** 52 /**
53 * If the resource has a scratch key, the key will be removed. Since scratch keys are installed
54 * at resource creation time, this means the resource will never again be us ed as scratch.
55 */
56 void removeScratchKey() const { fResource->removeScratchKey(); }
57
58 /**
53 * If the resource is currently cached by a content key, the key is returned , otherwise NULL. 59 * If the resource is currently cached by a content key, the key is returned , otherwise NULL.
54 */ 60 */
55 const GrResourceKey* getContentKey() const { 61 const GrResourceKey* getContentKey() const {
56 if (fResource->fFlags & GrGpuResource::kContentKeySet_Flag) { 62 if (fResource->fFlags & GrGpuResource::kContentKeySet_Flag) {
57 return &fResource->fContentKey; 63 return &fResource->fContentKey;
58 } 64 }
59 return NULL; 65 return NULL;
60 } 66 }
61 67
62 /** 68 /**
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 friend class GrGpuResource; // to construct/copy this type. 113 friend class GrGpuResource; // to construct/copy this type.
108 }; 114 };
109 115
110 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); } 116 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); }
111 117
112 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { 118 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const {
113 return CacheAccess(const_cast<GrGpuResource*>(this)); 119 return CacheAccess(const_cast<GrGpuResource*>(this));
114 } 120 }
115 121
116 #endif 122 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698