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

Unified Diff: gm/colorcube.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 | « bench/ColorCubeBench.cpp ('k') | gm/etc1bitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/colorcube.cpp
diff --git a/gm/colorcube.cpp b/gm/colorcube.cpp
index 519f88a6a5e4cfedf2a10b5def6862dbf633e55f..fa9eea9f99098d6b5020070fd233367288ec1ca5 100644
--- a/gm/colorcube.cpp
+++ b/gm/colorcube.cpp
@@ -9,6 +9,7 @@
#include "SkColorCubeFilter.h"
#include "SkData.h"
#include "SkGradientShader.h"
+#include "SkTemplates.h"
namespace skiagm {
@@ -72,10 +73,10 @@ protected:
void make_3Dlut(SkData** data, int size, bool invR, bool invG, bool invB) {
*data = SkData::NewUninitialized(sizeof(SkColor) * size * size * size);
SkColor* pixels = (SkColor*)((*data)->writable_data());
- SkAutoMalloc lutMemory(size);
- SkAutoMalloc invLutMemory(size);
- uint8_t* lut = (uint8_t*)lutMemory.get();
- uint8_t* invLut = (uint8_t*)invLutMemory.get();
+ SkAutoTMalloc<uint8_t> lutMemory(size);
+ SkAutoTMalloc<uint8_t> invLutMemory(size);
+ uint8_t* lut = lutMemory.get();
+ uint8_t* invLut = invLutMemory.get();
const int maxIndex = size - 1;
for (int i = 0; i < size; i++) {
lut[i] = (i * 255) / maxIndex;
« no previous file with comments | « bench/ColorCubeBench.cpp ('k') | gm/etc1bitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698