From 65a87cc13d6babcf12844cca244ca7cc5258cadc Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 14 Aug 2012 13:15:44 +0000 Subject: [PATCH] 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 --- bench/benchmain.cpp | 5 ++++- include/core/SkPath.h | 3 +++ src/core/SkPath.cpp | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) 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 @@ static void help() { } int main (int argc, char * const argv[]) { +#ifdef SK_ENABLE_INST_COUNT + gPrintInstCount = true; +#endif SkAutoGraphics ag; - + SkTDict 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 SkString; */ 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... -- 2.7.4