aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkResourceCache.cpp
diff options
context:
space:
mode:
authorGravatar ssid <ssid@chromium.org>2015-10-01 12:41:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-01 12:41:35 -0700
commit60df542afc3b792c6d563db2dfe233f65a2c3632 (patch)
tree0d1dba947bc107ef600b78ca5238628a6696db40 /src/core/SkResourceCache.cpp
parent77a53de20d723ca21cc824fd97e68aaa60e022ea (diff)
Strip font name of special characters before dumping
The font name can contain special characters in some OS that is considered as delimiters ('/') by the traces. This causes error in the dump name. This CL strips the fone name obtained before adding it to traces. This also adds discardable memory size for resources in cache. BUG=532838 Review URL: https://codereview.chromium.org/1346993006
Diffstat (limited to 'src/core/SkResourceCache.cpp')
-rw-r--r--src/core/SkResourceCache.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index a1234e1fef..240d1977e5 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -679,6 +679,10 @@ static void sk_trace_dump_visitor(const SkResourceCache::Rec& rec, void* context
SkDiscardableMemory* discardable = rec.diagnostic_only_getDiscardable();
if (discardable) {
dump->setDiscardableMemoryBacking(dumpName.c_str(), *discardable);
+
+ // The discardable memory size will be calculated by dumper, but we also dump what we think
+ // the size of object in memory is irrespective of whether object is live or dead.
+ dump->dumpNumericValue(dumpName.c_str(), "discardable_size", "bytes", rec.bytesUsed());
} else {
dump->dumpNumericValue(dumpName.c_str(), "size", "bytes", rec.bytesUsed());
dump->setMemoryBacking(dumpName.c_str(), "malloc", nullptr);