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

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

Issue 222343002: SkTDynamicHash: remove need for Equals(const T&, const Key&) param. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/core/SkTDynamicHash.h ('k') | src/gpu/GrTMultiMap.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 2011 Google Inc. 3 * Copyright 2011 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 9
10 10
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 /////////////////////////////////////////////////////////////////////////////// 116 ///////////////////////////////////////////////////////////////////////////////
117 117
118 class GrResourceEntry { 118 class GrResourceEntry {
119 public: 119 public:
120 GrResource* resource() const { return fResource; } 120 GrResource* resource() const { return fResource; }
121 const GrResourceKey& key() const { return fKey; } 121 const GrResourceKey& key() const { return fKey; }
122 122
123 static const GrResourceKey& GetKey(const GrResourceEntry& e) { return e.key( ); } 123 static const GrResourceKey& GetKey(const GrResourceEntry& e) { return e.key( ); }
124 static uint32_t Hash(const GrResourceKey& key) { return key.getHash(); } 124 static uint32_t Hash(const GrResourceKey& key) { return key.getHash(); }
125 static bool Equal(const GrResourceEntry& a, const GrResourceKey& b) {
126 return a.key() == b;
127 }
128 #ifdef SK_DEBUG 125 #ifdef SK_DEBUG
129 void validate() const; 126 void validate() const;
130 #else 127 #else
131 void validate() const {} 128 void validate() const {}
132 #endif 129 #endif
133 130
134 private: 131 private:
135 GrResourceEntry(const GrResourceKey& key, GrResource* resource); 132 GrResourceEntry(const GrResourceKey& key, GrResource* resource);
136 ~GrResourceEntry(); 133 ~GrResourceEntry();
137 134
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 }; 311 };
315 312
316 void internalDetach(GrResourceEntry*, BudgetBehaviors behavior = kAccountFor _BudgetBehavior); 313 void internalDetach(GrResourceEntry*, BudgetBehaviors behavior = kAccountFor _BudgetBehavior);
317 void attachToHead(GrResourceEntry*, BudgetBehaviors behavior = kAccountFor_B udgetBehavior); 314 void attachToHead(GrResourceEntry*, BudgetBehaviors behavior = kAccountFor_B udgetBehavior);
318 315
319 void removeInvalidResource(GrResourceEntry* entry); 316 void removeInvalidResource(GrResourceEntry* entry);
320 317
321 GrTMultiMap<GrResourceEntry, 318 GrTMultiMap<GrResourceEntry,
322 GrResourceKey, 319 GrResourceKey,
323 GrResourceEntry::GetKey, 320 GrResourceEntry::GetKey,
324 GrResourceEntry::Hash, 321 GrResourceEntry::Hash> fCache;
325 GrResourceEntry::Equal> fCache;
326 322
327 // We're an internal doubly linked list 323 // We're an internal doubly linked list
328 typedef SkTInternalLList<GrResourceEntry> EntryList; 324 typedef SkTInternalLList<GrResourceEntry> EntryList;
329 EntryList fList; 325 EntryList fList;
330 326
331 #ifdef SK_DEBUG 327 #ifdef SK_DEBUG
332 // These objects cannot be returned by a search 328 // These objects cannot be returned by a search
333 EntryList fExclusiveList; 329 EntryList fExclusiveList;
334 #endif 330 #endif
335 331
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 GrResourceCache* fCache; 378 GrResourceCache* fCache;
383 }; 379 };
384 #else 380 #else
385 class GrAutoResourceCacheValidate { 381 class GrAutoResourceCacheValidate {
386 public: 382 public:
387 GrAutoResourceCacheValidate(GrResourceCache*) {} 383 GrAutoResourceCacheValidate(GrResourceCache*) {}
388 }; 384 };
389 #endif 385 #endif
390 386
391 #endif 387 #endif
OLDNEW
« no previous file with comments | « src/core/SkTDynamicHash.h ('k') | src/gpu/GrTMultiMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698