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

Unified Diff: src/core/SkBitmapCache.cpp

Issue 1271033002: private iterator to visit all resource cache entries (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add iter for fontcache Created 5 years, 4 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
Index: src/core/SkBitmapCache.cpp
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp
index 3f1feac7bb8c1ef28b8e5ae91f1f1bcc86b59d88..08e3fdc71f1dbd60e380ddd34aed4245f164a3c6 100644
--- a/src/core/SkBitmapCache.cpp
+++ b/src/core/SkBitmapCache.cpp
@@ -74,6 +74,11 @@ struct BitmapRec : public SkResourceCache::Rec {
const Key& getKey() const override { return fKey; }
size_t bytesUsed() const override { return sizeof(fKey) + fBitmap.getSize(); }
+ const char* getCategory() const override { return "bitmap"; }
+ SkDiscardableMemory* diagnostic_only_getDiscardable() const override {
+ return fBitmap.pixelRef()->diagnostic_only_getDiscardable();
+ }
+
static bool Finder(const SkResourceCache::Rec& baseRec, void* contextBitmap) {
const BitmapRec& rec = static_cast<const BitmapRec&>(baseRec);
SkBitmap* result = (SkBitmap*)contextBitmap;
@@ -187,6 +192,10 @@ struct MipMapRec : public SkResourceCache::Rec {
const Key& getKey() const override { return fKey; }
size_t bytesUsed() const override { return sizeof(fKey) + fMipMap->size(); }
+ const char* getCategory() const override { return "mipmap"; }
+ SkDiscardableMemory* diagnostic_only_getDiscardable() const override {
+ return fMipMap->diagnostic_only_getDiscardable();
+ }
static bool Finder(const SkResourceCache::Rec& baseRec, void* contextMip) {
const MipMapRec& rec = static_cast<const MipMapRec&>(baseRec);
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/core/SkCachedData.h » ('j') | src/core/SkGlyphCache.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698