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

Unified Diff: src/core/SkBitmap.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/SkWebpCodec.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index e8a235597dfb182738b48bb5a705956bdff1bbea..8997f2b0140b41f62d1096e847f10b03a4cfaaa8 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -17,6 +17,7 @@
#include "SkReadBuffer.h"
#include "SkRect.h"
#include "SkScalar.h"
+#include "SkTemplates.h"
#include "SkUnPreMultiply.h"
#include "SkWriteBuffer.h"
@@ -1082,8 +1083,8 @@ static void write_raw_pixels(SkWriteBuffer* buffer, const SkPixmap& pmap) {
info.flatten(*buffer);
const size_t size = snugRB * info.height();
- SkAutoMalloc storage(size);
- char* dst = (char*)storage.get();
+ SkAutoTMalloc<char> storage(size);
+ char* dst = storage.get();
for (int y = 0; y < info.height(); ++y) {
memcpy(dst, src, snugRB);
dst += snugRB;
« no previous file with comments | « src/codec/SkWebpCodec.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698