diff options
author | Robert Phillips <robertphillips@google.com> | 2018-05-04 13:12:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-04 17:54:43 +0000 |
commit | bd66caa7ac38b68487778064eab10d76bc1d2e48 (patch) | |
tree | ea04baef2eb65c3e027aef6e736de9037a8b8108 /src/gpu/effects | |
parent | 72de74504f09f5de17af281b363fbc114ece3e73 (diff) |
Make degenerate kernel in fill_in_2D_gaussian_kernel sum to 1
Bug: 836113
Change-Id: I1b2ed1d67648163571df6c497365d2a293b3b589
Reviewed-on: https://skia-review.googlesource.com/126020
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrMatrixConvolutionEffect.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 56b012afe5..f7e6675c80 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -220,9 +220,11 @@ static void fill_in_2D_gaussian_kernel(float* kernel, int width, int height, if (SkScalarNearlyZero(twoSigmaSqrdX, SK_ScalarNearlyZero) || SkScalarNearlyZero(twoSigmaSqrdY, SK_ScalarNearlyZero)) { + SkASSERT(3 == width && 3 == height); for (int i = 0; i < width * height; ++i) { kernel[i] = 0.0f; } + kernel[4] = 1.0f; return; } |