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

Unified Diff: bench/MatrixConvolutionBench.cpp

Issue 1886523002: distinguish distinct matrixconvolution benchmarks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: invert Created 4 years, 8 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/MatrixConvolutionBench.cpp
diff --git a/bench/MatrixConvolutionBench.cpp b/bench/MatrixConvolutionBench.cpp
index da61891e732792f317ad7c687b381d9916ab5bf2..3a43de863d9b74fb8ca09b2cc935fcf8768de181 100644
--- a/bench/MatrixConvolutionBench.cpp
+++ b/bench/MatrixConvolutionBench.cpp
@@ -11,10 +11,21 @@
#include "SkRandom.h"
#include "SkString.h"
+static const char* name(SkMatrixConvolutionImageFilter::TileMode mode) {
+ switch (mode) {
+ case SkMatrixConvolutionImageFilter::kClamp_TileMode: return "clamp";
+ case SkMatrixConvolutionImageFilter::kRepeat_TileMode: return "repeat";
+ case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode: return "clampToBlack";
+ }
+ return "oops";
+}
+
class MatrixConvolutionBench : public Benchmark {
public:
MatrixConvolutionBench(SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAlpha)
- : fName("matrixconvolution") {
+ : fName(SkStringPrintf("matrixconvolution_%s%s",
+ name(tileMode),
+ convolveAlpha ? "" : "_noConvolveAlpha")) {
SkISize kernelSize = SkISize::Make(3, 3);
SkScalar kernel[9] = {
SkIntToScalar( 1), SkIntToScalar( 1), SkIntToScalar( 1),
@@ -23,7 +34,7 @@ public:
};
SkScalar gain = 0.3f, bias = SkIntToScalar(100);
SkIPoint kernelOffset = SkIPoint::Make(1, 1);
- fFilter = SkMatrixConvolutionImageFilter::Make(kernelSize, kernel, gain, bias,
+ fFilter = SkMatrixConvolutionImageFilter::Make(kernelSize, kernel, gain, bias,
kernelOffset, tileMode, convolveAlpha,
nullptr);
}
« 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