diff options
author | scroggo <scroggo@google.com> | 2015-12-10 10:44:13 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-10 10:44:13 -0800 |
commit | 565901db954c231840750ea955ed31b820b9ade8 (patch) | |
tree | 376c6355e252cd946babb6a267adba2e016efab4 /tests/BitmapCopyTest.cpp | |
parent | 9907371f0a79776d90b68d534aeb44eb46acafe5 (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.cpp | 5 |
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; |