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

Unified Diff: bench/SkLinearBitmapPipelineBench.cpp

Issue 1703203003: Don't you just feel bad every time you type 'delete'? (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/SkLinearBitmapPipelineBench.cpp
diff --git a/bench/SkLinearBitmapPipelineBench.cpp b/bench/SkLinearBitmapPipelineBench.cpp
index ea00638c9366168644075ef0f173127fb28bb6c0..149e9e2bad17c88b7f8e21530dae42d263917c46 100644
--- a/bench/SkLinearBitmapPipelineBench.cpp
+++ b/bench/SkLinearBitmapPipelineBench.cpp
@@ -132,7 +132,7 @@ struct SkBitmapFPGeneral final : public CommonBitmapFPBenchmark {
int width = fSrcSize.fWidth;
int height = fSrcSize.fHeight;
- SkPM4f* FPbuffer = new SkPM4f[width * height];
+ SkAutoTMalloc<SkPM4f> FPbuffer(width*height);
SkLinearBitmapPipeline pipeline{fInvert, fXTile, fYTile, fInfo, fBitmap.get(), };
@@ -141,9 +141,6 @@ struct SkBitmapFPGeneral final : public CommonBitmapFPBenchmark {
for (int n = 0; n < 1000*loops; n++) {
pipeline.shadeSpan4f(3, 6, FPbuffer, count);
}
-
- delete [] FPbuffer;
-
}
};
@@ -185,7 +182,7 @@ struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark {
int width = fSrcSize.fWidth;
int height = fSrcSize.fHeight;
- SkPMColor *buffer4b = new SkPMColor[width * height];
+ SkAutoTMalloc<SkPMColor> buffer4b(width*height);
uint32_t storage[200];
SkASSERT(fPaint.getShader()->contextSize() <= sizeof(storage));
@@ -200,7 +197,6 @@ struct SkBitmapFPOrigShader : public CommonBitmapFPBenchmark {
}
ctx->~Context();
- delete buffer4b;
}
SkPaint fPaint;
SkAutoTUnref<SkImage> fImage;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698