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

Unified Diff: src/core/SkGlyphCache.h

Issue 1313793004: [tracing] Add support for skia caches to dump memory stats (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Commit missed files. 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
« no previous file with comments | « include/core/SkGraphics.h ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGlyphCache.h
diff --git a/src/core/SkGlyphCache.h b/src/core/SkGlyphCache.h
index dc2aa579a739d10a5e6e317aa77c611d4b0ac01c..c58235f8ef22ee466d07171e8e406b1bd38ac4c2 100644
--- a/src/core/SkGlyphCache.h
+++ b/src/core/SkGlyphCache.h
@@ -17,6 +17,7 @@
#include "SkTDArray.h"
class SkPaint;
+class SkTraceMemoryDump;
class SkGlyphCache_Globals;
@@ -97,9 +98,12 @@ public:
return fScalerContext->isSubpixel();
}
+ /** Return the approx RAM usage for this cache. */
+ size_t getMemoryUsed() const { return fMemoryUsed; }
+
void dump() const;
- /* AuxProc/Data allow a client to associate data with this cache entry. Multiple clients can
+ /** AuxProc/Data allow a client to associate data with this cache entry. Multiple clients can
use this, as their data is keyed with a function pointer. In addition to serving as a
key, the function pointer is called with the data when the glyphcache object is deleted,
so the client can cleanup their data as well.
@@ -141,6 +145,11 @@ public:
static void Dump();
+ /** Dump memory usage statistics of all the attaches caches in the process using the
+ SkTraceMemoryDump interface.
+ */
+ static void DumpMemoryStatistics(SkTraceMemoryDump* dump);
+
typedef void (*Visitor)(const SkGlyphCache&, void* context);
static void VisitAll(Visitor, void* context);
« no previous file with comments | « include/core/SkGraphics.h ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698