aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-15 20:37:04 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-15 20:37:04 +0000
commit4e23068b374023d43c4c725138d523721d975892 (patch)
tree21ed906fac0e47f766a7a36f55c2a4c9d95ed6b3 /include
parent9222838fe650a221a9b5e9400f33f46c9ae43eda (diff)
Re-enable inst counting in debug builds.
R=robertphillips@google.com Review URL: https://codereview.appspot.com/7098066 git-svn-id: http://skia.googlecode.com/svn/trunk@7206 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/config/SkUserConfig.h2
-rw-r--r--include/core/SkInstCnt.h7
-rw-r--r--include/core/SkPostConfig.h11
3 files changed, 14 insertions, 6 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 2b1be9f49d..63fc90db72 100644
--- a/include/config/SkUserConfig.h
+++ b/include/config/SkUserConfig.h
@@ -79,7 +79,7 @@
allow instance count tracking in either debug or release builds. By
default it is enabled in debug but disabled in release.
*/
-//#define SK_ENABLE_INST_COUNT
+//#define SK_ENABLE_INST_COUNT 1
/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
it will call SK_CRASH(). If this is not defined it, it is defined in
diff --git a/include/core/SkInstCnt.h b/include/core/SkInstCnt.h
index 02b63dba99..e7f752edf5 100644
--- a/include/core/SkInstCnt.h
+++ b/include/core/SkInstCnt.h
@@ -18,12 +18,9 @@
* At the end of an application a call to all the "root" objects'
* CheckInstanceCount methods should be made
*/
-//#if defined SK_DEBUG && !defined SK_ENABLE_INST_COUNT
-//#define SK_ENABLE_INST_COUNT
-//#endif
+#include "SkTypes.h"
-#ifdef SK_ENABLE_INST_COUNT
-#include <stdlib.h>
+#if SK_ENABLE_INST_COUNT
#include "SkTArray.h"
#include "SkThread_platform.h"
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 86798e40ce..128cfa4dc3 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -112,6 +112,17 @@
///////////////////////////////////////////////////////////////////////////////
+// SK_ENABLE_INST_COUNT defaults to 1 in DEBUG and 0 in RELEASE
+#ifndef SK_ENABLE_INST_COUNT
+ #ifdef SK_DEBUG
+ #define SK_ENABLE_INST_COUNT 1
+ #else
+ #define SK_ENABLE_INST_COUNT 0
+ #endif
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+
#if defined(SK_SOFTWARE_FLOAT) && defined(SK_SCALAR_IS_FLOAT)
// if this is defined, we convert floats to 2scompliment ints for compares
#ifndef SK_SCALAR_SLOW_COMPARES