Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: tests/CanvasTest.cpp

Issue 1516833003: Switch SkAutoMalloc to SkAutoTMalloc to avoid cast (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Go back to patch set 3 Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/BitmapCopyTest.cpp ('k') | tests/TextureCompressionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tests/BitmapCopyTest.cpp ('k') | tests/TextureCompressionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698