aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/MatrixConvolutionBench.cpp
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-25 14:32:42 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-25 14:32:42 +0000
commit8640d5024d57da5508bdf7585849e3b1f1cb365b (patch)
tree7fbf975b21bfd199135354d0a34b561e7150f029 /bench/MatrixConvolutionBench.cpp
parent63e0ffde9faf7e5e233128f4bc5459eee23a2a17 (diff)
This patch adds support for optional processing of the alpha channel in
the matrix convolution filter. Test cases are added to the GM and the bench. NOTE: This will require rebaselining the matrixconvolution GM, so it will likely turn the bots red until that is done. https://codereview.appspot.com/6547049/ git-svn-id: http://skia.googlecode.com/svn/trunk@5661 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/MatrixConvolutionBench.cpp')
-rw-r--r--bench/MatrixConvolutionBench.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/bench/MatrixConvolutionBench.cpp b/bench/MatrixConvolutionBench.cpp
index 1f6a004270..dfa05dbd35 100644
--- a/bench/MatrixConvolutionBench.cpp
+++ b/bench/MatrixConvolutionBench.cpp
@@ -15,7 +15,7 @@ class MatrixConvolutionBench : public SkBenchmark {
SkMatrixConvolutionImageFilter::TileMode fTileMode;
public:
- MatrixConvolutionBench(void* param, SkMatrixConvolutionImageFilter::TileMode tileMode)
+ MatrixConvolutionBench(void* param, SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAlpha)
: INHERITED(param), fName("matrixconvolution") {
SkISize kernelSize = SkISize::Make(3, 3);
SkScalar kernel[9] = {
@@ -25,7 +25,7 @@ public:
};
SkScalar gain = SkFloatToScalar(0.3f), bias = SkIntToScalar(100);
SkIPoint target = SkIPoint::Make(1, 1);
- fFilter = new SkMatrixConvolutionImageFilter(kernelSize, kernel, gain, bias, target, tileMode);
+ fFilter = new SkMatrixConvolutionImageFilter(kernelSize, kernel, gain, bias, target, tileMode, convolveAlpha);
}
~MatrixConvolutionBench() {
@@ -56,10 +56,12 @@ private:
SkString fName;
};
-static SkBenchmark* Fact00(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kClamp_TileMode); }
-static SkBenchmark* Fact01(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kRepeat_TileMode); }
-static SkBenchmark* Fact02(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kClampToBlack_TileMode); }
+static SkBenchmark* Fact00(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kClamp_TileMode, true); }
+static SkBenchmark* Fact01(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kRepeat_TileMode, true); }
+static SkBenchmark* Fact02(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kClampToBlack_TileMode, true); }
+static SkBenchmark* Fact03(void* p) { return new MatrixConvolutionBench(p, SkMatrixConvolutionImageFilter::kClampToBlack_TileMode, false); }
static BenchRegistry gReg00(Fact00);
static BenchRegistry gReg01(Fact01);
static BenchRegistry gReg02(Fact02);
+static BenchRegistry gReg03(Fact03);