From 565901db954c231840750ea955ed31b820b9ade8 Mon Sep 17 00:00:00 2001 From: scroggo Date: Thu, 10 Dec 2015 10:44:13 -0800 Subject: 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 --- tests/CanvasTest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/CanvasTest.cpp') 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(storage.get()); + SkAutoTMalloc storage(size); + SkPMColor* baseAddr = storage.get(); sk_bzero(baseAddr, size); SkCanvas* canvas = SkCanvas::NewRasterDirect(info, baseAddr, minRowBytes); -- cgit v1.2.3