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

Unified Diff: src/codec/SkSampledCodec.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 | « src/codec/SkJpegCodec.cpp ('k') | src/codec/SkWebpCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSampledCodec.cpp
diff --git a/src/codec/SkSampledCodec.cpp b/src/codec/SkSampledCodec.cpp
index 52e5648742ecea5a2c82f32f198dbd365a8f17be..38859ad6be3b41e8edbacd747792f3fa66dde976 100644
--- a/src/codec/SkSampledCodec.cpp
+++ b/src/codec/SkSampledCodec.cpp
@@ -9,6 +9,7 @@
#include "SkCodecPriv.h"
#include "SkMath.h"
#include "SkSampledCodec.h"
+#include "SkTemplates.h"
SkSampledCodec::SkSampledCodec(SkCodec* codec)
: INHERITED(codec->getInfo())
@@ -267,8 +268,8 @@ SkCodec::Result SkSampledCodec::sampledDecode(const SkImageInfo& info, void* pix
}
case SkCodec::kNone_SkScanlineOrder: {
const int linesNeeded = subsetHeight - samplingOffsetY;
- SkAutoMalloc storage(linesNeeded * rowBytes);
- uint8_t* storagePtr = static_cast<uint8_t*>(storage.get());
+ SkAutoTMalloc<uint8_t> storage(linesNeeded * rowBytes);
+ uint8_t* storagePtr = storage.get();
if (!fCodec->skipScanlines(startY)) {
fCodec->fillIncompleteImage(info, pixels, rowBytes, options.fZeroInitialized,
« no previous file with comments | « src/codec/SkJpegCodec.cpp ('k') | src/codec/SkWebpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698