aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CanvasTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CanvasTest.cpp')
-rw-r--r--tests/CanvasTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 2ec25e4bab..87705dc7f5 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);