Index: src/core/SkMask.cpp |
diff --git a/src/core/SkMask.cpp b/src/core/SkMask.cpp |
index 4ae65c7a9cc871b64952e7e90c8a295f9855e43f..111508074a3e7f34cc2849ac77609eee0efce49e 100644 |
--- a/src/core/SkMask.cpp |
+++ b/src/core/SkMask.cpp |
@@ -7,6 +7,8 @@ |
#include "SkMask.h" |
+//#define TRACK_SKMASK_LIFETIME |
+ |
/** returns the product if it is positive and fits in 31 bits. Otherwise this |
returns 0. |
*/ |
@@ -30,10 +32,17 @@ size_t SkMask::computeTotalImageSize() const { |
return size; |
} |
+#ifdef TRACK_SKMASK_LIFETIME |
+ static int gCounter; |
+#endif |
+ |
/** We explicitly use this allocator for SkBimap pixels, so that we can |
freely assign memory allocated by one class to the other. |
*/ |
uint8_t* SkMask::AllocImage(size_t size) { |
+#ifdef TRACK_SKMASK_LIFETIME |
+ SkDebugf("SkMask::AllocImage %d\n", gCounter++); |
+#endif |
return (uint8_t*)sk_malloc_throw(SkAlign4(size)); |
} |
@@ -41,6 +50,11 @@ uint8_t* SkMask::AllocImage(size_t size) { |
freely assign memory allocated by one class to the other. |
*/ |
void SkMask::FreeImage(void* image) { |
+#ifdef TRACK_SKMASK_LIFETIME |
+ if (image) { |
+ SkDebugf("SkMask::FreeImage %d\n", --gCounter); |
+ } |
+#endif |
sk_free(image); |
} |