Index: tests/BitmapHeapTest.cpp |
diff --git a/tests/BitmapHeapTest.cpp b/tests/BitmapHeapTest.cpp |
index f3385644bd132a33ff24c2d1571016711304fac6..c7d097278b3501a6765599642b34c16940f1a229 100644 |
--- a/tests/BitmapHeapTest.cpp |
+++ b/tests/BitmapHeapTest.cpp |
@@ -17,9 +17,15 @@ |
struct SimpleFlatController : public SkFlatController { |
SimpleFlatController() : SkFlatController() {} |
- virtual void* allocThrow(size_t bytes) SK_OVERRIDE { return sk_malloc_throw(bytes); } |
- virtual void unalloc(void* ptr) SK_OVERRIDE { sk_free(ptr); } |
+ ~SimpleFlatController() { fAllocations.freeAll(); } |
+ virtual void* allocThrow(size_t bytes) SK_OVERRIDE { |
+ fAllocations.push(sk_malloc_throw(bytes)); |
+ return fAllocations.top(); |
+ } |
+ virtual void unalloc(void*) SK_OVERRIDE { } |
void setBitmapStorage(SkBitmapHeap* h) { this->setBitmapHeap(h); } |
+private: |
+ SkTDArray<void*> fAllocations; |
}; |
struct SkShaderTraits { |