diff options
author | 2013-07-11 22:29:29 +0000 | |
---|---|---|
committer | 2013-07-11 22:29:29 +0000 | |
commit | ef284a84f503adfd08ee52b5aee142c548698ea4 (patch) | |
tree | f5f6fea1a5769031df5336a9a4c30ae45c1159a9 /src | |
parent | 40ea172f1ee50320fd690ace2cfcb84c09b86731 (diff) |
The two leaks are:
missing unrefs in megalooper GM
missing reset capability in oval renderer
This CL also expands the instance counting system to some recently adding classes (e.g., SkFontStyleSet)
R=bsalomon@google.com, jvanverth@google.com
Author: robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/18461007
git-svn-id: http://skia.googlecode.com/svn/trunk@10030 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkFontHost.cpp | 5 | ||||
-rw-r--r-- | src/doc/SkDocument.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrOvalRenderer.cpp | 4 | ||||
-rw-r--r-- | src/lazy/SkBitmapFactory.cpp | 2 | ||||
-rw-r--r-- | src/lazy/SkLruImageCache.cpp | 3 | ||||
-rw-r--r-- | src/lazy/SkPurgeableImageCache.cpp | 1 |
7 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkFontHost.cpp b/src/core/SkFontHost.cpp index 5fabb0fc59..734b3aa1b8 100644 --- a/src/core/SkFontHost.cpp +++ b/src/core/SkFontHost.cpp @@ -68,6 +68,9 @@ SkFontStyle::SkFontStyle(int weight, int width, Slant slant) { #include "SkFontMgr.h" + +SK_DEFINE_INST_COUNT(SkFontStyleSet) + class SkEmptyFontStyleSet : public SkFontStyleSet { public: virtual int count() SK_OVERRIDE { return 0; } @@ -89,6 +92,8 @@ SkFontStyleSet* SkFontStyleSet::CreateEmpty() { /////////////////////////////////////////////////////////////////////////////// +SK_DEFINE_INST_COUNT(SkFontMgr) + class SkEmptyFontMgr : public SkFontMgr { protected: virtual int onCountFamilies() SK_OVERRIDE { diff --git a/src/doc/SkDocument.cpp b/src/doc/SkDocument.cpp index b051300617..e94c89bbeb 100644 --- a/src/doc/SkDocument.cpp +++ b/src/doc/SkDocument.cpp @@ -8,6 +8,8 @@ #include "SkDocument.h" #include "SkStream.h" +SK_DEFINE_INST_COUNT(SkDocument) + SkDocument::SkDocument(SkWStream* stream, void (*doneProc)(SkWStream*)) { fStream = stream; // we do not own this object. fDoneProc = doneProc; diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 39d0db33b4..d9924bf314 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -198,6 +198,7 @@ void GrContext::contextDestroyed() { fDrawBufferIBAllocPool = NULL; fAARectRenderer->reset(); + fOvalRenderer->reset(); fTextureCache->purgeAllUnlocked(); fFontCache->freeAll(); @@ -214,6 +215,7 @@ void GrContext::freeGpuResources() { fGpu->purgeResources(); fAARectRenderer->reset(); + fOvalRenderer->reset(); fTextureCache->purgeAllUnlocked(); fFontCache->freeAll(); diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index bcd64d740d..85526dc6b3 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -286,6 +286,10 @@ GrEffectRef* EllipseEdgeEffect::TestCreate(SkMWCRandom* random, /////////////////////////////////////////////////////////////////////////////// +void GrOvalRenderer::reset() { + GrSafeSetNull(fRRectIndexBuffer); +} + bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bool useAA, const GrRect& oval, const SkStrokeRec& stroke) { diff --git a/src/lazy/SkBitmapFactory.cpp b/src/lazy/SkBitmapFactory.cpp index 60c4993e3c..0ff4ee2d17 100644 --- a/src/lazy/SkBitmapFactory.cpp +++ b/src/lazy/SkBitmapFactory.cpp @@ -13,6 +13,8 @@ #include "SkImagePriv.h" #include "SkLazyPixelRef.h" +SK_DEFINE_INST_COUNT(SkBitmapFactory::CacheSelector) + SkBitmapFactory::SkBitmapFactory(SkBitmapFactory::DecodeProc proc) : fDecodeProc(proc) , fImageCache(NULL) diff --git a/src/lazy/SkLruImageCache.cpp b/src/lazy/SkLruImageCache.cpp index 26f7ef5483..40cfefa29b 100644 --- a/src/lazy/SkLruImageCache.cpp +++ b/src/lazy/SkLruImageCache.cpp @@ -7,6 +7,9 @@ #include "SkLruImageCache.h" +SK_DEFINE_INST_COUNT(SkImageCache) +SK_DEFINE_INST_COUNT(SkLruImageCache) + static intptr_t NextGenerationID() { static intptr_t gNextID; do { diff --git a/src/lazy/SkPurgeableImageCache.cpp b/src/lazy/SkPurgeableImageCache.cpp index 0f2c5e3c8e..0d36e4a9a9 100644 --- a/src/lazy/SkPurgeableImageCache.cpp +++ b/src/lazy/SkPurgeableImageCache.cpp @@ -13,6 +13,7 @@ #include "SkTSearch.h" #endif +SK_DEFINE_INST_COUNT(SkPurgeableImageCache) SK_DECLARE_STATIC_MUTEX(gPurgeableImageMutex); SkImageCache* SkPurgeableImageCache::Create() { |