diff options
author | 2012-06-21 20:25:03 +0000 | |
---|---|---|
committer | 2012-06-21 20:25:03 +0000 | |
commit | 15e9d3e66e161ce23df30bc13f8a0c87d196b463 (patch) | |
tree | 2cc4661f85d92a98de30e7bca582163321fc018d /include/core/SkInstCnt.h | |
parent | c82a8b7aa4ec19fba508c394920a9e88d3e5bd12 (diff) |
Expanded distribution of instance counting
http://codereview.appspot.com/6300114/
git-svn-id: http://skia.googlecode.com/svn/trunk@4291 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkInstCnt.h')
-rw-r--r-- | include/core/SkInstCnt.h | 11 |
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); \ } \ } \ \ |