OLD | NEW |
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 | 9 |
10 #include "GrResourceCache.h" | 10 #include "GrResourceCache.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class GrResourceCache::AutoValidate : ::SkNoncopyable { | 49 class GrResourceCache::AutoValidate : ::SkNoncopyable { |
50 public: | 50 public: |
51 AutoValidate(GrResourceCache* cache) : fCache(cache) { cache->validate(); } | 51 AutoValidate(GrResourceCache* cache) : fCache(cache) { cache->validate(); } |
52 ~AutoValidate() { fCache->validate(); } | 52 ~AutoValidate() { fCache->validate(); } |
53 private: | 53 private: |
54 GrResourceCache* fCache; | 54 GrResourceCache* fCache; |
55 }; | 55 }; |
56 | 56 |
57 ////////////////////////////////////////////////////////////////////////////// | 57 ////////////////////////////////////////////////////////////////////////////// |
58 | 58 |
59 static const int kDefaultMaxCount = 2 * (1 << 10); | 59 static const int kDefaultMaxCount = 2 * (1 << 12); |
60 static const size_t kDefaultMaxSize = 96 * (1 << 20); | 60 static const size_t kDefaultMaxSize = 96 * (1 << 20); |
61 | 61 |
62 GrResourceCache::GrResourceCache() | 62 GrResourceCache::GrResourceCache() |
63 : fTimestamp(0) | 63 : fTimestamp(0) |
64 , fMaxCount(kDefaultMaxCount) | 64 , fMaxCount(kDefaultMaxCount) |
65 , fMaxBytes(kDefaultMaxSize) | 65 , fMaxBytes(kDefaultMaxSize) |
66 #if GR_CACHE_STATS | 66 #if GR_CACHE_STATS |
67 , fHighWaterCount(0) | 67 , fHighWaterCount(0) |
68 , fHighWaterBytes(0) | 68 , fHighWaterBytes(0) |
69 , fBudgetedHighWaterCount(0) | 69 , fBudgetedHighWaterCount(0) |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 return true; | 630 return true; |
631 } | 631 } |
632 if (index < fNonpurgeableResources.count() && fNonpurgeableResources[index]
== resource) { | 632 if (index < fNonpurgeableResources.count() && fNonpurgeableResources[index]
== resource) { |
633 return true; | 633 return true; |
634 } | 634 } |
635 SkDEBUGFAIL("Resource index should be -1 or the resource should be in the ca
che."); | 635 SkDEBUGFAIL("Resource index should be -1 or the resource should be in the ca
che."); |
636 return false; | 636 return false; |
637 } | 637 } |
638 | 638 |
639 #endif | 639 #endif |
OLD | NEW |