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

Side by Side Diff: include/gpu/GrGpuResource.h

Issue 546043002: Don't take a ref on GP in AutoEffectRestore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 6 years, 3 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 | « no previous file | include/gpu/GrProgramElement.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 2014 Google Inc. 2 * Copyright 2014 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 GrGpuResource_DEFINED 8 #ifndef GrGpuResource_DEFINED
9 #define GrGpuResource_DEFINED 9 #define GrGpuResource_DEFINED
10 10
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn try; } 165 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn try; }
166 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; } 166 GrResourceCacheEntry* getCacheEntry() { return fCacheEntry; }
167 167
168 /** 168 /**
169 * If this resource can be used as a scratch resource this returns a valid 169 * If this resource can be used as a scratch resource this returns a valid
170 * scratch key. Otherwise it returns a key for which isNullScratch is true. 170 * scratch key. Otherwise it returns a key for which isNullScratch is true.
171 */ 171 */
172 const GrResourceKey& getScratchKey() const { return fScratchKey; } 172 const GrResourceKey& getScratchKey() const { return fScratchKey; }
173 173
174 /** 174 /**
175 * Gets an id that is unique for this GrCacheable object. It is static in th at it does 175 * Gets an id that is unique for this GrGpuResource object. It is static in that it does
176 * not change when the content of the GrCacheable object changes. This will never return 176 * not change when the content of the GrGpuResource object changes. This wil l never return
177 * 0. 177 * 0.
178 */ 178 */
179 uint32_t getUniqueID() const { return fUniqueID; } 179 uint32_t getUniqueID() const { return fUniqueID; }
180 180
181 protected: 181 protected:
182 // This must be called by every GrGpuObject. It should be called once the ob ject is fully 182 // This must be called by every GrGpuObject. It should be called once the ob ject is fully
183 // initialized (i.e. not in a base class constructor). 183 // initialized (i.e. not in a base class constructor).
184 void registerWithCache(); 184 void registerWithCache();
185 185
186 GrGpuResource(GrGpu*, bool isWrapped); 186 GrGpuResource(GrGpu*, bool isWrapped);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache 239 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
240 const uint32_t fUniqueID; 240 const uint32_t fUniqueID;
241 241
242 GrResourceKey fScratchKey; 242 GrResourceKey fScratchKey;
243 243
244 typedef GrGpuRef INHERITED; 244 typedef GrGpuRef INHERITED;
245 }; 245 };
246 246
247 #endif 247 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrProgramElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698