diff options
author | reed <reed@google.com> | 2014-09-16 10:39:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-16 10:39:55 -0700 |
commit | 30ad5306be25565484a3dd76237984e071b7c4b3 (patch) | |
tree | 3a54680bf9bc826a5dba45da01a7637e5a17a2cb /src/core/SkResourceCache.h | |
parent | 4815fe5a0a497b676677fb4e4a0f05c511855490 (diff) |
allow SkBitmapCache to operate on a local instance, for testability
BUG=skia:
R=mtklein@google.com, danakj@chromium.org, piotaixr@chromium.org, junov@chromium.org
Author: reed@google.com
Review URL: https://codereview.chromium.org/576763002
Diffstat (limited to 'src/core/SkResourceCache.h')
-rw-r--r-- | src/core/SkResourceCache.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h index d4e1dfa376..52196985d3 100644 --- a/src/core/SkResourceCache.h +++ b/src/core/SkResourceCache.h @@ -126,6 +126,11 @@ public: static void PurgeAll(); /** + * Returns the DiscardableFactory used by the global cache, or NULL. + */ + static DiscardableFactory GetDiscardableFactory(); + + /** * Use this allocator for bitmaps, so they can use ashmem when available. * Returns NULL if the ResourceCache has not been initialized with a DiscardableFactory. */ @@ -189,6 +194,7 @@ public: this->purgeAsNeeded(true); } + DiscardableFactory discardableFactory() const { return fDiscardableFactory; } SkBitmap::Allocator* allocator() const { return fAllocator; }; /** |