Chromium Code Reviews| Index: src/core/SkBlitter.cpp |
| diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
| index cb84ec7d9db0aaa75f8539f7789fba8a5090bc70..e6d2e11d99b46812333900e62c39a31269cd4cbb 100644 |
| --- a/src/core/SkBlitter.cpp |
| +++ b/src/core/SkBlitter.cpp |
| @@ -20,7 +20,12 @@ |
| #include "SkUtils.h" |
| #include "SkXfermode.h" |
| -SkBlitter::~SkBlitter() {} |
| +SkBlitter::~SkBlitter() { |
| + if (NULL != fBlitMemory) { |
| + sk_free(fBlitMemory); |
| + fBlitMemory = NULL; |
| + } |
| +} |
| bool SkBlitter::isNullBlitter() const { return false; } |
| @@ -193,6 +198,16 @@ void SkBlitter::blitMask(const SkMask& mask, const SkIRect& clip) { |
| } |
| } |
| +void* SkBlitter::allocBlitMemory(size_t sz) { |
| + if (NULL != fBlitMemory) { |
|
reed1
2014/07/21 14:51:13
Should this happen (we get called twice)?
krajcevski
2014/07/21 15:04:41
Added an assert to catch if it is, but we shouldn'
|
| + sk_free(fBlitMemory); |
| + fBlitMemory = NULL; |
| + } |
| + |
| + fBlitMemory = sk_malloc_throw(sz); |
| + return fBlitMemory; |
| +} |
| + |
| /////////////////////// these guys are not virtual, just a helpers |
| void SkBlitter::blitMaskRegion(const SkMask& mask, const SkRegion& clip) { |