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
diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp
index 8af70fb..6cf80a1 100644
--- a/src/core/SkAdvancedTypefaceMetrics.cpp
+++ b/src/core/SkAdvancedTypefaceMetrics.cpp
@@ -10,6 +10,8 @@
 #include "SkAdvancedTypefaceMetrics.h"
 #include "SkTypes.h"
 
+SK_DEFINE_INST_COUNT(SkAdvancedTypefaceMetrics)
+
 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
 #include <ft2build.h>
 #include FT_FREETYPE_H
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index a723113..9b616c6 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -20,6 +20,8 @@
 #include "SkPackBits.h"
 #include <new>
 
+SK_DEFINE_INST_COUNT(SkBitmap::Allocator)
+
 extern int32_t SkNextPixelRefGenerationID();
 
 static bool isPos32Bits(const Sk64& value) {
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index af2e066..fa9519e 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -21,6 +21,8 @@
 #include "SkTLazy.h"
 #include "SkUtils.h"
 
+SK_DEFINE_INST_COUNT(SkCanvas)
+
 //#define SK_TRACE_SAVERESTORE
 
 #ifdef SK_TRACE_SAVERESTORE
diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp
index f9f4043..495da88 100644
--- a/src/core/SkData.cpp
+++ b/src/core/SkData.cpp
@@ -10,6 +10,8 @@
 
 #include "SkData.h"
 
+SK_DEFINE_INST_COUNT(SkData)
+
 SkData::SkData(const void* ptr, size_t size, ReleaseProc proc, void* context) {
     fPtr = ptr;
     fSize = size;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index b92f4e1..c5dfc66 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -11,6 +11,8 @@
 #include "SkMetaData.h"
 #include "SkRect.h"
 
+SK_DEFINE_INST_COUNT(SkDevice)
+
 ///////////////////////////////////////////////////////////////////////////////
 
 SkDevice::SkDevice(const SkBitmap& bitmap) : fBitmap(bitmap) {
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
index c5abc8e..f4f242a 100644
--- a/src/core/SkDeviceProfile.cpp
+++ b/src/core/SkDeviceProfile.cpp
@@ -1,7 +1,15 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
 
 
 #include "SkDeviceProfile.h"
 
+SK_DEFINE_INST_COUNT(SkDeviceProfile)
+
 #define DEFAULT_GAMMAEXP        2.2f
 #define DEFAULT_CONTRASTSCALE   0.5f
 #define DEFAULT_LCDCONFIG       SkDeviceProfile::kNone_LCDConfig
diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp
index b8001f0..0232f75 100644
--- a/src/core/SkFlattenable.cpp
+++ b/src/core/SkFlattenable.cpp
@@ -8,6 +8,8 @@
 #include "SkFlattenable.h"
 #include "SkTypeface.h"
 
+SK_DEFINE_INST_COUNT(SkFlattenable)
+
 ///////////////////////////////////////////////////////////////////////////////
 
 void SkFlattenable::flatten(SkFlattenableWriteBuffer&) const
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 44307e0..10790d2 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -23,6 +23,8 @@
 #include "SkReader32.h"
 #include "SkWriter32.h"
 
+SK_DEFINE_INST_COUNT(SkPicture)
+
 #define DUMP_BUFFER_SIZE 65536
 
 //#define ENABLE_TIME_DRAW    // dumps milliseconds for each draw
diff --git a/src/core/SkPtrRecorder.cpp b/src/core/SkPtrRecorder.cpp
index e509464..4d1165b 100644
--- a/src/core/SkPtrRecorder.cpp
+++ b/src/core/SkPtrRecorder.cpp
@@ -8,6 +8,8 @@
 #include "SkPtrRecorder.h"
 #include "SkTSearch.h"
 
+SK_DEFINE_INST_COUNT(SkPtrSet)
+
 void SkPtrSet::reset() {
     Pair* p = fList.begin();
     Pair* stop = fList.end();
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index 8b71244..45eb183 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -13,6 +13,8 @@
 #include "SkString.h"
 #include "SkOSFile.h"
 
+SK_DEFINE_INST_COUNT(SkStream)
+
 SkStream::~SkStream() {}
 
 const char* SkStream::getFileName()
diff --git a/src/gpu/GrCustomStage.cpp b/src/gpu/GrCustomStage.cpp
index c7d0844..c0ec330 100644
--- a/src/gpu/GrCustomStage.cpp
+++ b/src/gpu/GrCustomStage.cpp
@@ -8,6 +8,8 @@
 #include "GrContext.h"
 #include "GrCustomStage.h"
 
+SK_DEFINE_INST_COUNT(GrCustomStage)
+
 int32_t GrProgramStageFactory::fCurrStageClassID =
                                     GrProgramStageFactory::kIllegalStageClassID;
 
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index abd4366..02e9337 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -11,6 +11,8 @@
 
 #include <stdio.h>
 
+SK_DEFINE_INST_COUNT(GrGLInterface)
+
 #if GR_GL_PER_GL_FUNC_CALLBACK
 namespace {
 void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp
index 3252b56..f67e68c 100644
--- a/src/gpu/gl/SkGLContext.cpp
+++ b/src/gpu/gl/SkGLContext.cpp
@@ -8,6 +8,8 @@
 #include "gl/SkGLContext.h"
 #include "gl/GrGLUtil.h"
 
+SK_DEFINE_INST_COUNT(SkGLContext)
+
 SkGLContext::SkGLContext()
     : fFBO(0)
     , fColorBufferID(0)
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index c076f84..2980896 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -13,6 +13,10 @@
 #include "SkStream.h"
 #include "SkTemplates.h"
 
+SK_DEFINE_INST_COUNT(SkImageDecoder::Peeker)
+SK_DEFINE_INST_COUNT(SkImageDecoder::Chooser)
+SK_DEFINE_INST_COUNT(SkImageDecoderFactory)
+
 static SkBitmap::Config gDeviceConfig = SkBitmap::kNo_Config;
 
 SkBitmap::Config SkImageDecoder::GetDeviceConfig()
diff --git a/src/images/SkMovie.cpp b/src/images/SkMovie.cpp
index 81820a5..978cd16 100644
--- a/src/images/SkMovie.cpp
+++ b/src/images/SkMovie.cpp
@@ -9,6 +9,8 @@
 #include "SkCanvas.h"
 #include "SkPaint.h"
 
+SK_DEFINE_INST_COUNT(SkMovie)
+
 // We should never see this in normal operation since our time values are
 // 0-based. So we use it as a sentinal.
 #define UNINITIALIZED_MSEC ((SkMSec)-1)
diff --git a/src/text/SkTextLayout.cpp b/src/text/SkTextLayout.cpp
index fda4b2f..4d87ffe 100644
--- a/src/text/SkTextLayout.cpp
+++ b/src/text/SkTextLayout.cpp
@@ -7,6 +7,8 @@
  */
 #include "SkTextLayout.h"
 
+SK_DEFINE_INST_COUNT(SkTextStyle)
+
 SkTextStyle::SkTextStyle() {
     fPaint.setAntiAlias(true);
 }