aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar ssid <ssid@chromium.org>2015-09-30 04:31:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-30 04:31:23 -0700
commitf0c986503b982cfbd4d859573c11bc2a154b42f5 (patch)
treed866b873bd06634a572f9358d23c06a4ae5b183b /include
parentb39abc4d7661733edeaad379dddac75defe67dd4 (diff)
Add support for light dumps in SkTraceMemoryDump interface.
SkGlyphCache dumps too many glyphs, and to reduce the trace size, RequestDetails enum is added to SkTraceMemoryDump interface. This would tell caches to dump only requested details or not a detailed dump. BUG=499731 Review URL: https://codereview.chromium.org/1310123007
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTraceMemoryDump.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/core/SkTraceMemoryDump.h b/include/core/SkTraceMemoryDump.h
index d7c565f570..8383190ccc 100644
--- a/include/core/SkTraceMemoryDump.h
+++ b/include/core/SkTraceMemoryDump.h
@@ -20,6 +20,17 @@ class SkDiscardableMemory;
class SK_API SkTraceMemoryDump {
public:
/**
+ * Enum to specify the level of the requested details for the dump from the Skia objects.
+ */
+ enum LevelOfDetail {
+ // Dump only the minimal details to get the total memory usage (Usually just the totals).
+ kLight_LevelOfDetail,
+
+ // Dump the detailed breakdown of the objects in the caches.
+ kObjectsBreakdowns_LevelOfDetail
+ };
+
+ /**
* Appends a new memory dump (i.e. a row) to the trace memory infrastructure.
* If dumpName does not exist yet, a new one is created. Otherwise, a new column is appended to
* the previously created dump.
@@ -55,6 +66,13 @@ public:
const char* dumpName,
const SkDiscardableMemory& discardableMemoryObject) = 0;
+ /**
+ * Returns the type of details requested in the dump. The granularity of the dump is supposed to
+ * match the LevelOfDetail argument. The level of detail must not affect the total size
+ * reported, but only granularity of the child entries.
+ */
+ virtual LevelOfDetail getRequestedDetails() const = 0;
+
protected:
virtual ~SkTraceMemoryDump() { }
};