diff options
author | piotaixr <piotaixr@chromium.org> | 2014-09-02 11:27:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-02 11:27:11 -0700 |
commit | 8159146699f691b88f60564fc0811a6da3e8693f (patch) | |
tree | 51332afe696c736e3f57a959e9639f646f2c4419 /src | |
parent | 98d709bc8d0761df8e0ad35e92c06e500f0be50d (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')
-rw-r--r-- | src/core/SkBitmapCache.h | 5 | ||||
-rw-r--r-- | src/core/SkResourceCache.h | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h index 74e8546353..9291ff5702 100644 --- a/src/core/SkBitmapCache.h +++ b/src/core/SkBitmapCache.h @@ -16,7 +16,8 @@ class SkMipMap; class SkBitmapCache { public: /** - * Use this allocator for bitmaps, so they can use ashmem when available. + * 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(); @@ -25,7 +26,7 @@ public: * result will be set to the matching bitmap with its pixels already locked. */ static bool Find(const SkBitmap& src, SkScalar invScaleX, SkScalar invScaleY, SkBitmap* result); - + /* * result must be marked isImmutable() */ 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(); /** |