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

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

Issue 707493002: Use GrResourceCache2 to service content key lookups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move #ifdef SK_SUPPORT_GPU Created 6 years, 1 month 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 | « include/gpu/GrContext.h ('k') | src/core/SkTMultiMap.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 165
166 /** 166 /**
167 * Retrieves the amount of GPU memory used by this resource in bytes. It is 167 * Retrieves the amount of GPU memory used by this resource in bytes. It is
168 * approximate since we aren't aware of additional padding or copies made 168 * approximate since we aren't aware of additional padding or copies made
169 * by the driver. 169 * by the driver.
170 * 170 *
171 * @return the amount of GPU memory used in bytes 171 * @return the amount of GPU memory used in bytes
172 */ 172 */
173 virtual size_t gpuMemorySize() const = 0; 173 virtual size_t gpuMemorySize() const = 0;
174 174
175 void setCacheEntry(GrResourceCacheEntry* cacheEntry) { fCacheEntry = cacheEn try; } 175 bool setCacheEntry(GrResourceCacheEntry* cacheEntry);
176 GrResourceCacheEntry* getCacheEntry() const { return fCacheEntry; } 176 GrResourceCacheEntry* getCacheEntry() const { return fCacheEntry; }
177 bool isScratch() const; 177 bool isScratch() const;
178 178
179 /** 179 /**
180 * If this resource can be used as a scratch resource this returns a valid 180 * If this resource can be used as a scratch resource this returns a valid
181 * scratch key. Otherwise it returns a key for which isNullScratch is true. 181 * scratch key. Otherwise it returns a key for which isNullScratch is true.
182 */ 182 */
183 const GrResourceKey& getScratchKey() const { return fScratchKey; } 183 const GrResourceKey& getScratchKey() const { return fScratchKey; }
184 184
185 /** 185 /**
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache 258 GrResourceCacheEntry* fCacheEntry; // NULL if not in cache
259 const uint32_t fUniqueID; 259 const uint32_t fUniqueID;
260 260
261 GrResourceKey fScratchKey; 261 GrResourceKey fScratchKey;
262 262
263 typedef GrIORef<GrGpuResource> INHERITED; 263 typedef GrIORef<GrGpuResource> INHERITED;
264 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable. 264 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgable.
265 }; 265 };
266 266
267 #endif 267 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkTMultiMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698