Switch SkAutoMalloc to SkAutoTMalloc to avoid cast
Make SkAutoTMalloc's interface look more like SkAutoMalloc:
- add free(), which does what you expect
- make reset() return a pointer fPtr
No public API changes (SkAutoTMalloc is in include/private)
BUG=skia:2148
Review URL: https://codereview.chromium.org/1516833003
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 65427ff..6db63fa 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -7,6 +7,7 @@
#include "SkBitmap.h"
#include "SkRect.h"
+#include "SkTemplates.h"
#include "Test.h"
static const char* boolStr(bool value) {
@@ -420,8 +421,8 @@
// raw buffer pointer.
const size_t bufSize = subH *
SkColorTypeMinRowBytes(src.colorType(), subW) * 2;
- SkAutoMalloc autoBuf (bufSize);
- uint8_t* buf = static_cast<uint8_t*>(autoBuf.get());
+ SkAutoTMalloc<uint8_t> autoBuf (bufSize);
+ uint8_t* buf = autoBuf.get();
SkBitmap bufBm; // Attach buf to this bitmap.
bool successExpected;