aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkResourceCache.h
diff options
context:
space:
mode:
authorGravatar piotaixr <piotaixr@chromium.org>2014-09-02 11:27:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-02 11:27:11 -0700
commit8159146699f691b88f60564fc0811a6da3e8693f (patch)
tree51332afe696c736e3f57a959e9639f646f2c4419 /src/core/SkResourceCache.h
parent98d709bc8d0761df8e0ad35e92c06e500f0be50d (diff)
Added Doc for GetAllocator in SkResourceCache and SkBitmapCache
BUG=skia:2896 R=junov@chromium.org, reed@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/533713003
Diffstat (limited to 'src/core/SkResourceCache.h')
-rw-r--r--src/core/SkResourceCache.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index 0873bd4c2e..f2fd8fc047 100644
--- a/src/core/SkResourceCache.h
+++ b/src/core/SkResourceCache.h
@@ -64,10 +64,10 @@ public:
virtual ~Rec() {}
uint32_t getHash() const { return this->getKey().hash(); }
-
+
virtual const Key& getKey() const = 0;
virtual size_t bytesUsed() const = 0;
-
+
// for SkTDynamicHash::Traits
static uint32_t Hash(const Key& key) { return key.hash(); }
static const Key& GetKey(const Rec& rec) { return rec.getKey(); }
@@ -77,7 +77,7 @@ public:
Rec* fPrev;
int32_t fLockCount;
int32_t fPad;
-
+
friend class SkResourceCache;
};
@@ -106,6 +106,10 @@ public:
static size_t SetSingleAllocationByteLimit(size_t);
static size_t GetSingleAllocationByteLimit();
+ /**
+ * Use this allocator for bitmaps, so they can use ashmem when available.
+ * Returns NULL if the ResourceCache has not been initialized with a DiscardableFactory.
+ */
static SkBitmap::Allocator* GetAllocator();
/**