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

Unified Diff: gm/etc1bitmap.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 | « gm/colorcube.cpp ('k') | include/effects/SkColorCubeFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/etc1bitmap.cpp
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp
index bbe75610ef6cec68200eb405074f91363c653a2d..d9b08d1e8642c34af15f84f2ab1546d9583ee950 100644
--- a/gm/etc1bitmap.cpp
+++ b/gm/etc1bitmap.cpp
@@ -13,6 +13,7 @@
#include "SkImageGenerator.h"
#include "SkImageDecoder.h"
#include "SkOSFile.h"
+#include "SkTemplates.h"
#ifndef SK_IGNORE_ETC1_SUPPORT
@@ -46,9 +47,9 @@ bool slice_etc1_data(void *data, int* width, int* height) {
int newHeight = (blockHeight - 1) << 2;
size_t newDataSz = etc1_get_encoded_data_size(newWidth, newHeight) + ETC_PKM_HEADER_SIZE;
- SkAutoMalloc am(newDataSz);
+ SkAutoTMalloc<etc1_byte> am(newDataSz);
- etc1_byte *newData = reinterpret_cast<etc1_byte *>(am.get());
+ etc1_byte* newData = am.get();
etc1_pkm_format_header(newData, newWidth, newHeight);
newData += ETC_PKM_HEADER_SIZE;
« no previous file with comments | « gm/colorcube.cpp ('k') | include/effects/SkColorCubeFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698