From 8640d5024d57da5508bdf7585849e3b1f1cb365b Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Tue, 25 Sep 2012 14:32:42 +0000 Subject: 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 --- bench/MatrixConvolutionBench.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bench/MatrixConvolutionBench.cpp') 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); -- cgit v1.2.3