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

Unified Diff: bench/ColorCubeBench.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 | « no previous file | gm/colorcube.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorCubeBench.cpp
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp
index 55d17261669e2b42d7f3ca26c95d8f7ababbeb7e..6c5a16d6a212bf03d362408ef71742dcb0fb7dc7 100644
--- a/bench/ColorCubeBench.cpp
+++ b/bench/ColorCubeBench.cpp
@@ -8,6 +8,7 @@
#include "SkCanvas.h"
#include "SkColorCubeFilter.h"
#include "SkGradientShader.h"
+#include "SkTemplates.h"
class ColorCubeBench : public Benchmark {
SkISize fSize;
@@ -75,8 +76,8 @@ private:
fCubeData = SkData::NewUninitialized(sizeof(SkColor) *
fCubeDimension * fCubeDimension * fCubeDimension);
SkColor* pixels = (SkColor*)(fCubeData->writable_data());
- SkAutoMalloc lutMemory(fCubeDimension);
- uint8_t* lut = (uint8_t*)lutMemory.get();
+ SkAutoTMalloc<uint8_t> lutMemory(fCubeDimension);
+ uint8_t* lut = lutMemory.get();
const int maxIndex = fCubeDimension - 1;
for (int i = 0; i < fCubeDimension; ++i) {
// Make an invert lut, but the content of
« no previous file with comments | « no previous file | gm/colorcube.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698