aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkInstCnt.h
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-21 20:25:03 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-21 20:25:03 +0000
commit15e9d3e66e161ce23df30bc13f8a0c87d196b463 (patch)
tree2cc4661f85d92a98de30e7bca582163321fc018d /include/core/SkInstCnt.h
parentc82a8b7aa4ec19fba508c394920a9e88d3e5bd12 (diff)
Expanded distribution of instance counting
Diffstat (limited to 'include/core/SkInstCnt.h')
-rw-r--r--include/core/SkInstCnt.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
index e5c44db11c..087d5a7431 100644
--- a/include/core/SkInstCnt.h
+++ b/include/core/SkInstCnt.h
@@ -31,7 +31,7 @@
#define SK_DECLARE_INST_COUNT_INTERNAL(className, initStep) \
class SkInstanceCountHelper { \
public: \
- typedef void (*PFCheckInstCnt)(); \
+ typedef void (*PFCheckInstCnt)(int level); \
SkInstanceCountHelper() { \
if (!gInited) { \
initStep \
@@ -57,13 +57,14 @@
return SkInstanceCountHelper::gInstanceCount; \
} \
\
- static void CheckInstanceCount() { \
+ static void CheckInstanceCount(int level = 0) { \
if (0 != SkInstanceCountHelper::gInstanceCount) { \
- SkDebugf("Leaked %s objects: %d\n", #className, \
+ SkDebugf("%*c Leaked %s objects: %d\n", \
+ 4*level, ' ', #className, \
SkInstanceCountHelper::gInstanceCount); \
} \
- for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) { \
- (*SkInstanceCountHelper::gChildren[i])(); \
+ for (int i = 0; i < SkInstanceCountHelper::gChildren.count(); ++i) {\
+ (*SkInstanceCountHelper::gChildren[i])(level+1); \
} \
} \
\