diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 14:58:06 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-16 14:58:06 +0000 |
commit | a22e2117e44efa4298dd0eb6df304a8166c8e9c3 (patch) | |
tree | 727738c19786a7c5caf1e09ccfe431b652d8b302 /src/core | |
parent | 1f47f4f7325971dd53991e2bb02da94fa7c6d962 (diff) |
Extended Inst counting to find "unknown" leaked object (SkTMaskGamma)
http://codereview.appspot.com/6453127/
git-svn-id: http://skia.googlecode.com/svn/trunk@5123 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmapHeap.cpp | 3 | ||||
-rw-r--r-- | src/core/SkBitmapHeap.h | 7 | ||||
-rw-r--r-- | src/core/SkMaskGamma.h | 4 | ||||
-rw-r--r-- | src/core/SkPictureFlat.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPictureFlat.h | 4 | ||||
-rw-r--r-- | src/core/SkPtrRecorder.cpp | 1 | ||||
-rw-r--r-- | src/core/SkPtrRecorder.h | 4 | ||||
-rw-r--r-- | src/core/SkScalerContext.cpp | 16 |
8 files changed, 34 insertions, 7 deletions
diff --git a/src/core/SkBitmapHeap.cpp b/src/core/SkBitmapHeap.cpp index 7caf1a5fd5..1867af21c4 100644 --- a/src/core/SkBitmapHeap.cpp +++ b/src/core/SkBitmapHeap.cpp @@ -12,6 +12,9 @@ #include "SkFlattenableBuffers.h" #include "SkTSearch.h" +SK_DEFINE_INST_COUNT(SkBitmapHeapReader) +SK_DEFINE_INST_COUNT(SkBitmapHeap::ExternalStorage) + SkBitmapHeapEntry::SkBitmapHeapEntry() : fSlot(-1) , fRefCount(0) diff --git a/src/core/SkBitmapHeap.h b/src/core/SkBitmapHeap.h index a16727b640..61e1dd905d 100644 --- a/src/core/SkBitmapHeap.h +++ b/src/core/SkBitmapHeap.h @@ -52,6 +52,8 @@ private: class SkBitmapHeapReader : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(SkBitmapHeapReader) + SkBitmapHeapReader() : INHERITED() {} virtual SkBitmap* getBitmap(int32_t slot) const = 0; virtual void releaseRef(int32_t slot) = 0; @@ -67,7 +69,12 @@ class SkBitmapHeap : public SkBitmapHeapReader { public: class ExternalStorage : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(ExternalStorage) + virtual bool insert(const SkBitmap& bitmap, int32_t slot) = 0; + + private: + typedef SkRefCnt INHERITED; }; static const int32_t UNLIMITED_SIZE = -1; diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h index 7498f64d87..f3fab033fc 100644 --- a/src/core/SkMaskGamma.h +++ b/src/core/SkMaskGamma.h @@ -105,6 +105,8 @@ void SkTMaskGamma_build_correcting_lut(uint8_t table[256], U8CPU srcI, SkScalar */ template <int R_LUM_BITS, int G_LUM_BITS, int B_LUM_BITS> class SkTMaskGamma : public SkRefCnt { public: + SK_DECLARE_INST_COUNT_TEMPLATE(SkTMaskGamma) + /** * Creates tables to convert linear alpha values to gamma correcting alpha * values. @@ -151,6 +153,8 @@ private: : (R_LUM_BITS > G_LUM_BITS ? R_LUM_BITS : G_LUM_BITS) }; uint8_t fGammaTables[1 << kLuminanceBits_Max][256]; + + typedef SkRefCnt INHERITED; }; /** diff --git a/src/core/SkPictureFlat.cpp b/src/core/SkPictureFlat.cpp index 87664ca306..c66689fa79 100644 --- a/src/core/SkPictureFlat.cpp +++ b/src/core/SkPictureFlat.cpp @@ -16,6 +16,8 @@ #include "SkTypeface.h" #include "SkXfermode.h" +SK_DEFINE_INST_COUNT(SkFlatController) + /////////////////////////////////////////////////////////////////////////////// SkTypefacePlayback::SkTypefacePlayback() : fCount(0), fArray(NULL) {} diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h index 53fd69ac6f..b4f0625631 100644 --- a/src/core/SkPictureFlat.h +++ b/src/core/SkPictureFlat.h @@ -158,6 +158,8 @@ class SkFlatData; class SkFlatController : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(SkFlatController) + SkFlatController(); virtual ~SkFlatController(); /** @@ -244,6 +246,8 @@ private: SkTypefacePlayback* fTypefacePlayback; SkNamedFactorySet* fFactorySet; uint32_t fWriteBufferFlags; + + typedef SkRefCnt INHERITED; }; class SkFlatData { diff --git a/src/core/SkPtrRecorder.cpp b/src/core/SkPtrRecorder.cpp index 169944a98a..6ee58f886a 100644 --- a/src/core/SkPtrRecorder.cpp +++ b/src/core/SkPtrRecorder.cpp @@ -9,6 +9,7 @@ #include "SkTSearch.h" SK_DEFINE_INST_COUNT(SkPtrSet) +SK_DEFINE_INST_COUNT(SkNamedFactorySet) void SkPtrSet::reset() { Pair* p = fList.begin(); diff --git a/src/core/SkPtrRecorder.h b/src/core/SkPtrRecorder.h index 8a48325298..c4c0bd8832 100644 --- a/src/core/SkPtrRecorder.h +++ b/src/core/SkPtrRecorder.h @@ -123,6 +123,8 @@ class SkFactorySet : public SkTPtrSet<SkFlattenable::Factory> {}; */ class SkNamedFactorySet : public SkRefCnt { public: + SK_DECLARE_INST_COUNT(SkNamedFactorySet) + SkNamedFactorySet(); /** @@ -142,6 +144,8 @@ private: int fNextAddedFactory; SkFactorySet fFactorySet; SkTDArray<const char*> fNames; + + typedef SkRefCnt INHERITED; }; #endif diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 3fbcf3bf5b..e2725ffdfb 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -22,6 +22,8 @@ #include "SkStroke.h" #include "SkThread.h" +SK_DEFINE_INST_COUNT(SkMaskGamma) + #define ComputeBWRowBytes(width) (((unsigned)(width) + 7) >> 3) void SkGlyph::toMask(SkMask* mask) const { @@ -301,9 +303,9 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) { } } - if (SkMask::kARGB32_Format != glyph->fMaskFormat) { - glyph->fMaskFormat = fRec.fMaskFormat; - } + if (SkMask::kARGB32_Format != glyph->fMaskFormat) { + glyph->fMaskFormat = fRec.fMaskFormat; + } if (fMaskFilter) { SkMask src, dst; @@ -764,10 +766,10 @@ protected: extern SkScalerContext* SkCreateColorScalerContext(const SkDescriptor* desc); SkScalerContext* SkScalerContext::Create(const SkDescriptor* desc) { - SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); - if (NULL == c) { - c = SkFontHost::CreateScalerContext(desc); - } + SkScalerContext* c = NULL; //SkCreateColorScalerContext(desc); + if (NULL == c) { + c = SkFontHost::CreateScalerContext(desc); + } if (NULL == c) { c = SkNEW_ARGS(SkScalerContext_Empty, (desc)); } |