diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-04 21:25:00 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-10-04 21:25:00 +0000 |
commit | 02f55841854ae32f21a13417e9ee711463e488cf (patch) | |
tree | fab3bae2934075a02cc8ddd801b7b1ff8e648f4e /include/core | |
parent | a30bc82a2e7163235b01a6b2ecbd4e2c0906c0b8 (diff) |
Change SkAutoMaskImage so that we're less likely to write leaky code.
http://codereview.appspot.com/5180047/
git-svn-id: http://skia.googlecode.com/svn/trunk@2409 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkMaskFilter.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h index b32f4d3926..0f1321e086 100644 --- a/include/core/SkMaskFilter.h +++ b/include/core/SkMaskFilter.h @@ -97,16 +97,13 @@ protected: Stack class used to manage the fImage buffer in a SkMask. When this object loses scope, the buffer is freed with SkMask::FreeImage(). */ -class SkAutoMaskImage { +class SkAutoMaskFreeImage { public: - SkAutoMaskImage(SkMask* mask, bool alloc) { - if (alloc) { - mask->fImage = SkMask::AllocImage(mask->computeImageSize()); - } - fImage = mask->fImage; + SkAutoMaskFreeImage(uint8_t* maskImage) { + fImage = maskImage; } - ~SkAutoMaskImage() { + ~SkAutoMaskFreeImage() { SkMask::FreeImage(fImage); } private: |