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

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

Issue 923143002: Split out methods in GrGpuResource::CacheAccess that can be called outside of the cache. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: do warning workaround in the right place 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/GrGpuResourcePriv.h ('k') | src/gpu/GrResourceCache.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 GrResourceCache_DEFINED 9 #ifndef GrResourceCache_DEFINED
10 #define GrResourceCache_DEFINED 10 #define GrResourceCache_DEFINED
11 11
12 #include "GrGpuResource.h" 12 #include "GrGpuResource.h"
13 #include "GrGpuResourceCacheAccess.h" 13 #include "GrGpuResourcePriv.h"
14 #include "GrResourceKey.h" 14 #include "GrResourceKey.h"
15 #include "SkMessageBus.h" 15 #include "SkMessageBus.h"
16 #include "SkRefCnt.h" 16 #include "SkRefCnt.h"
17 #include "SkTArray.h" 17 #include "SkTArray.h"
18 #include "SkTInternalLList.h" 18 #include "SkTInternalLList.h"
19 #include "SkTMultiMap.h" 19 #include "SkTMultiMap.h"
20 20
21 class SkString; 21 class SkString;
22 22
23 /** 23 /**
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 #else 191 #else
192 void validate() const {} 192 void validate() const {}
193 #endif 193 #endif
194 194
195 class AutoValidate; 195 class AutoValidate;
196 196
197 class AvailableForScratchUse; 197 class AvailableForScratchUse;
198 198
199 struct ScratchMapTraits { 199 struct ScratchMapTraits {
200 static const GrScratchKey& GetKey(const GrGpuResource& r) { 200 static const GrScratchKey& GetKey(const GrGpuResource& r) {
201 return r.cacheAccess().getScratchKey(); 201 return r.resourcePriv().getScratchKey();
202 } 202 }
203 203
204 static uint32_t Hash(const GrScratchKey& key) { return key.hash(); } 204 static uint32_t Hash(const GrScratchKey& key) { return key.hash(); }
205 }; 205 };
206 typedef SkTMultiMap<GrGpuResource, GrScratchKey, ScratchMapTraits> ScratchMa p; 206 typedef SkTMultiMap<GrGpuResource, GrScratchKey, ScratchMapTraits> ScratchMa p;
207 207
208 struct ContentHashTraits { 208 struct ContentHashTraits {
209 static const GrContentKey& GetKey(const GrGpuResource& r) { 209 static const GrContentKey& GetKey(const GrGpuResource& r) {
210 return r.getContentKey(); 210 return r.getContentKey();
211 } 211 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 friend class GrGpuResource; // To access all the proxy inline methods. 320 friend class GrGpuResource; // To access all the proxy inline methods.
321 friend class GrResourceCache; // To create this type. 321 friend class GrResourceCache; // To create this type.
322 }; 322 };
323 323
324 inline GrResourceCache::ResourceAccess GrResourceCache::resourceAccess() { 324 inline GrResourceCache::ResourceAccess GrResourceCache::resourceAccess() {
325 return ResourceAccess(this); 325 return ResourceAccess(this);
326 } 326 }
327 327
328 #endif 328 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourcePriv.h ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698