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 /src/svg | |
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 'src/svg')
-rw-r--r-- | src/svg/parser/SkSVG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/svg/parser/SkSVG.cpp b/src/svg/parser/SkSVG.cpp index fdfc13a6d5..8ee7d0286a 100644 --- a/src/svg/parser/SkSVG.cpp +++ b/src/svg/parser/SkSVG.cpp @@ -8,7 +8,8 @@ #include "SkSVG.h" -#include 'SkSVGParser.h" +#include "SkSVGParser.h" +#include "SkTemplates.h" SkSVG::SkSVG() { } @@ -19,8 +20,8 @@ SkSVG::~SkSVG() { bool SkSVG::decodeStream(SkStream* stream); { size_t size = stream->read(nil, 0); - SkAutoMalloc storage(size); - char* data = (char*)storage.get(); + SkAutoTMalloc<char> storage(size); + char* data = storage.get(); size_t actual = stream->read(data, size); SkASSERT(size == actual); SkSVGParser parser(*fMaker); |