Add inst counting to bench and count SkPaths
Review URL: http://codereview.appspot.com/6450129/
git-svn-id: http://skia.googlecode.com/svn/trunk@5076 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 73aa988..fa43155 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -439,8 +439,11 @@
}
int main (int argc, char * const argv[]) {
+#ifdef SK_ENABLE_INST_COUNT
+ gPrintInstCount = true;
+#endif
SkAutoGraphics ag;
-
+
SkTDict<const char*> defineDict(1024);
int repeatDraw = 1;
bool logPerIter = false;
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 2bd2d76..ae8ecb7 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -10,6 +10,7 @@
#ifndef SkPath_DEFINED
#define SkPath_DEFINED
+#include "SkInstCnt.h"
#include "SkMatrix.h"
#include "SkTDArray.h"
@@ -33,6 +34,8 @@
*/
class SK_API SkPath {
public:
+ SK_DECLARE_INST_COUNT_ROOT(SkPath);
+
SkPath();
SkPath(const SkPath&);
~SkPath();
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 1127e95..a9937ab 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -11,6 +11,8 @@
#include "SkBuffer.h"
#include "SkMath.h"
+SK_DEFINE_INST_COUNT(SkPath);
+
// This value is just made-up for now. When count is 4, calling memset was much
// slower than just writing the loop. This seems odd, and hopefully in the
// future this we appear to have been a fluke...