aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BitmapCopyTest.cpp
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2015-12-10 10:44:13 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-10 10:44:13 -0800
commit565901db954c231840750ea955ed31b820b9ade8 (patch)
tree376c6355e252cd946babb6a267adba2e016efab4 /tests/BitmapCopyTest.cpp
parent9907371f0a79776d90b68d534aeb44eb46acafe5 (diff)
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
Diffstat (limited to 'tests/BitmapCopyTest.cpp')
-rw-r--r--tests/BitmapCopyTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 65427ffd7b..6db63fae45 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -7,6 +7,7 @@
#include "SkBitmap.h"
#include "SkRect.h"
+#include "SkTemplates.h"
#include "Test.h"
static const char* boolStr(bool value) {
@@ -420,8 +421,8 @@ DEF_TEST(BitmapCopy, reporter) {
// raw buffer pointer.
const size_t bufSize = subH *
SkColorTypeMinRowBytes(src.colorType(), subW) * 2;
- SkAutoMalloc autoBuf (bufSize);
- uint8_t* buf = static_cast<uint8_t*>(autoBuf.get());
+ SkAutoTMalloc<uint8_t> autoBuf (bufSize);
+ uint8_t* buf = autoBuf.get();
SkBitmap bufBm; // Attach buf to this bitmap.
bool successExpected;