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; |