aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-27 19:41:42 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-27 19:41:42 +0000
commitb74af872cc1ce45768df3ae03fa86ad3ed76b582 (patch)
treed7af92a8668a2bd14e3e1cd1b162aeca08e178dd /include/core
parent006db0f1b8d85caea7ac37bc1fca133eca74aac8 (diff)
Separated Inst counting from the SK_DEBUG #define (now SK_ENABLE_INST_COUNT)
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkInstCnt.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
index ff9a19f252..18ea9bb75a 100644
--- a/include/core/SkInstCnt.h
+++ b/include/core/SkInstCnt.h
@@ -18,9 +18,11 @@
* At the end of an application a call to all the "root" objects'
* CheckInstanceCount methods should be made
*/
-#ifdef SK_DEBUG
+#ifdef SK_ENABLE_INST_COUNT
#include "SkTArray.h"
+extern bool gPrintInstCount;
+
#define SK_DECLARE_INST_COUNT(className) \
SK_DECLARE_INST_COUNT_INTERNAL(className, \
INHERITED::AddInstChild(CheckInstanceCount);)
@@ -58,7 +60,7 @@
} \
\
static int CheckInstanceCount(int level = 0) { \
- if (0 != SkInstanceCountHelper::gInstanceCount) { \
+ if (gPrintInstCount && 0 != SkInstanceCountHelper::gInstanceCount) {\
SkDebugf("%*c Leaked %s: %d\n", \
4*level, ' ', #className, \
SkInstanceCountHelper::gInstanceCount); \
@@ -69,7 +71,7 @@
count -= (*SkInstanceCountHelper::gChildren[i])(level+1); \
} \
SkASSERT(count >= 0); \
- if (childCount > 0 && count > 0) { \
+ if (gPrintInstCount && childCount > 0 && count > 0) { \
SkDebugf("%*c Leaked ???: %d\n", 4*(level + 1), ' ', count); \
} \
return SkInstanceCountHelper::gInstanceCount; \