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

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

Issue 1316263003: Revert of By default purge resources that haven't been used for 64 flushes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | 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
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 public: 50 public:
51 GrResourceCache(const GrCaps* caps); 51 GrResourceCache(const GrCaps* caps);
52 ~GrResourceCache(); 52 ~GrResourceCache();
53 53
54 // Default maximum number of budgeted resources in the cache. 54 // Default maximum number of budgeted resources in the cache.
55 static const int kDefaultMaxCount = 2 * (1 << 12); 55 static const int kDefaultMaxCount = 2 * (1 << 12);
56 // Default maximum number of bytes of gpu memory of budgeted resources in th e cache. 56 // Default maximum number of bytes of gpu memory of budgeted resources in th e cache.
57 static const size_t kDefaultMaxSize = 96 * (1 << 20); 57 static const size_t kDefaultMaxSize = 96 * (1 << 20);
58 // Default number of flushes a budgeted resources can go unused in the cache before it is 58 // Default number of flushes a budgeted resources can go unused in the cache before it is
59 // purged. Large values disable the feature (as the ring buffer of flush tim estamps would be 59 // purged. Large values disable the feature (as the ring buffer of flush tim estamps would be
60 // large). 60 // large). This is currently the default until we decide to enable this feat ure
61 static const int kDefaultMaxUnusedFlushes = 64; 61 // of the cache by default.
62 static const int kDefaultMaxUnusedFlushes = 1024;
62 63
63 /** Used to access functionality needed by GrGpuResource for lifetime manage ment. */ 64 /** Used to access functionality needed by GrGpuResource for lifetime manage ment. */
64 class ResourceAccess; 65 class ResourceAccess;
65 ResourceAccess resourceAccess(); 66 ResourceAccess resourceAccess();
66 67
67 /** 68 /**
68 * Sets the cache limits in terms of number of resources, max gpu memory byt e size, and number 69 * Sets the cache limits in terms of number of resources, max gpu memory byt e size, and number
69 * of GrContext flushes that a resource can be unused before it is evicted. The latter value is 70 * of GrContext flushes that a resource can be unused before it is evicted. The latter value is
70 * a suggestion and there is no promise that a resource will be purged immed iately after it 71 * a suggestion and there is no promise that a resource will be purged immed iately after it
71 * hasn't been used in maxUnusedFlushes flushes. 72 * hasn't been used in maxUnusedFlushes flushes.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 380
380 friend class GrGpuResource; // To access all the proxy inline methods. 381 friend class GrGpuResource; // To access all the proxy inline methods.
381 friend class GrResourceCache; // To create this type. 382 friend class GrResourceCache; // To create this type.
382 }; 383 };
383 384
384 inline GrResourceCache::ResourceAccess GrResourceCache::resourceAccess() { 385 inline GrResourceCache::ResourceAccess GrResourceCache::resourceAccess() {
385 return ResourceAccess(this); 386 return ResourceAccess(this);
386 } 387 }
387 388
388 #endif 389 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698