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

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

Issue 864343005: Revert of make getContentKey() available in GrGpuResource public interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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/GrResourceCache2.cpp » ('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 GrResourceCache2_DEFINED 9 #ifndef GrResourceCache2_DEFINED
10 #define GrResourceCache2_DEFINED 10 #define GrResourceCache2_DEFINED
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 static const GrScratchKey& GetKey(const GrGpuResource& r) { 187 static const GrScratchKey& GetKey(const GrGpuResource& r) {
188 return r.cacheAccess().getScratchKey(); 188 return r.cacheAccess().getScratchKey();
189 } 189 }
190 190
191 static uint32_t Hash(const GrScratchKey& key) { return key.hash(); } 191 static uint32_t Hash(const GrScratchKey& key) { return key.hash(); }
192 }; 192 };
193 typedef SkTMultiMap<GrGpuResource, GrScratchKey, ScratchMapTraits> ScratchMa p; 193 typedef SkTMultiMap<GrGpuResource, GrScratchKey, ScratchMapTraits> ScratchMa p;
194 194
195 struct ContentHashTraits { 195 struct ContentHashTraits {
196 static const GrContentKey& GetKey(const GrGpuResource& r) { 196 static const GrContentKey& GetKey(const GrGpuResource& r) {
197 return r.getContentKey(); 197 return r.cacheAccess().getContentKey();
198 } 198 }
199 199
200 static uint32_t Hash(const GrContentKey& key) { return key.hash(); } 200 static uint32_t Hash(const GrContentKey& key) { return key.hash(); }
201 }; 201 };
202 typedef SkTDynamicHash<GrGpuResource, GrContentKey, ContentHashTraits> Conte ntHash; 202 typedef SkTDynamicHash<GrGpuResource, GrContentKey, ContentHashTraits> Conte ntHash;
203 203
204 typedef SkTInternalLList<GrGpuResource> ResourceList; 204 typedef SkTInternalLList<GrGpuResource> ResourceList;
205 205
206 ResourceList fResources; 206 ResourceList fResources;
207 // This map holds all resources that can be used as scratch resources. 207 // This map holds all resources that can be used as scratch resources.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 friend class GrGpuResource; // To access all the proxy inline methods. 296 friend class GrGpuResource; // To access all the proxy inline methods.
297 friend class GrResourceCache2; // To create this type. 297 friend class GrResourceCache2; // To create this type.
298 }; 298 };
299 299
300 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() { 300 inline GrResourceCache2::ResourceAccess GrResourceCache2::resourceAccess() {
301 return ResourceAccess(this); 301 return ResourceAccess(this);
302 } 302 }
303 303
304 #endif 304 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698