Index: tests/CanvasTest.cpp |
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp |
index 2ec25e4bab023b699107b57cf92f0957c2c26e31..87705dc7f5e00cd6efb52bbb9e5efa04a7915994 100644 |
--- a/tests/CanvasTest.cpp |
+++ b/tests/CanvasTest.cpp |
@@ -61,6 +61,7 @@ |
#include "SkShader.h" |
#include "SkStream.h" |
#include "SkSurface.h" |
+#include "SkTemplates.h" |
#include "SkTDArray.h" |
#include "Test.h" |
@@ -635,8 +636,8 @@ static void test_newraster(skiatest::Reporter* reporter) { |
SkImageInfo info = SkImageInfo::MakeN32Premul(10, 10); |
const size_t minRowBytes = info.minRowBytes(); |
const size_t size = info.getSafeSize(minRowBytes); |
- SkAutoMalloc storage(size); |
- SkPMColor* baseAddr = static_cast<SkPMColor*>(storage.get()); |
+ SkAutoTMalloc<SkPMColor> storage(size); |
+ SkPMColor* baseAddr = storage.get(); |
sk_bzero(baseAddr, size); |
SkCanvas* canvas = SkCanvas::NewRasterDirect(info, baseAddr, minRowBytes); |