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

Unified Diff: src/core/SkResourceCache.h

Issue 533713003: Added Doc for GetAllocator in SkResourceCache and SkBitmapCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Please kill me Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmapCache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkResourceCache.h
diff --git a/src/core/SkResourceCache.h b/src/core/SkResourceCache.h
index 0873bd4c2efa099cd68ca53c18e9259d40d7b46e..f2fd8fc047443b64e0688c28cf3804ec78fbfbed 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();
/**
« no previous file with comments | « src/core/SkBitmapCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698