diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:33:07 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:33:07 +0000 |
commit | 227c24673196f5f06bee85e7e9aa067be90e1359 (patch) | |
tree | 0c9cb5e49e880dfff5936bb3b3be5509c26e1a33 /include | |
parent | dd10e0ec4c9aeeadcd922d3ad0bf01496d920978 (diff) |
Resolve a few memory leaks in tests.
Purge the global scaled image cache after use in tests. The cache was
right to hold on to the pixels indefinitely, but this change makes it
easier to run down actual memory leaks.
Add SK_DECLARE_INST_COUNT to several classes.
BUG=skia:
R=reed@google.com
Author: halcanary@google.com
Review URL: https://codereview.chromium.org/145443004
git-svn-id: http://skia.googlecode.com/svn/trunk@13171 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMallocPixelRef.h | 1 | ||||
-rw-r--r-- | include/gpu/SkGrPixelRef.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/core/SkMallocPixelRef.h b/include/core/SkMallocPixelRef.h index aaa045f948..6642af57bb 100644 --- a/include/core/SkMallocPixelRef.h +++ b/include/core/SkMallocPixelRef.h @@ -16,6 +16,7 @@ */ class SK_API SkMallocPixelRef : public SkPixelRef { public: + SK_DECLARE_INST_COUNT(SkMallocPixelRef) /** * Return a new SkMallocPixelRef with the provided pixel storage, rowBytes, * and optional colortable. The caller is responsible for managing the diff --git a/include/gpu/SkGrPixelRef.h b/include/gpu/SkGrPixelRef.h index 63e975673f..1e495611fc 100644 --- a/include/gpu/SkGrPixelRef.h +++ b/include/gpu/SkGrPixelRef.h @@ -20,6 +20,7 @@ */ class SK_API SkROLockPixelsPixelRef : public SkPixelRef { public: + SK_DECLARE_INST_COUNT(SkROLockPixelsPixelRef) SkROLockPixelsPixelRef(const SkImageInfo&); virtual ~SkROLockPixelsPixelRef(); @@ -38,6 +39,7 @@ private: */ class SK_API SkGrPixelRef : public SkROLockPixelsPixelRef { public: + SK_DECLARE_INST_COUNT(SkGrPixelRef) /** * Constructs a pixel ref around a GrSurface. If the caller has locked the GrSurface in the * cache and would like the pixel ref to unlock it in its destructor then transferCacheLock |