Index: tests/ARGBImageEncoderTest.cpp |
diff --git a/tests/ARGBImageEncoderTest.cpp b/tests/ARGBImageEncoderTest.cpp |
index 4d16f4cc6d5cabeab7a0dc977de4804cfefd6e94..62167f0f2ab0f425a2bb8185d6de0fe5915e3bbf 100644 |
--- a/tests/ARGBImageEncoderTest.cpp |
+++ b/tests/ARGBImageEncoderTest.cpp |
@@ -10,6 +10,7 @@ |
#include "SkBitmap.h" |
#include "SkCanvas.h" |
#include "SkStream.h" |
+#include "SkTemplates.h" |
#include "Test.h" |
static SkColorType gColorTypes[] = { |
@@ -49,8 +50,8 @@ DEF_TEST(ARGBImageEncoder, reporter) { |
// Transform the bitmap. |
int bufferSize = bitmap.width() * bitmap.height() * 4; |
- SkAutoMalloc pixelBufferManager(bufferSize); |
- char *pixelBuffer = static_cast<char *>(pixelBufferManager.get()); |
+ SkAutoTMalloc<char> pixelBufferManager(bufferSize); |
+ char* pixelBuffer = pixelBufferManager.get(); |
SkMemoryWStream out(pixelBuffer, bufferSize); |
REPORTER_ASSERT(reporter, enc->encodeStream(&out, bitmap, SkImageEncoder::kDefaultQuality)); |