Index: src/effects/SkMatrixConvolutionImageFilter.cpp |
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp |
index e3711d29b911e4579eb4e2f1a56939310394efbd..6368096fbcc06a638dfaa4586506bff7222391d5 100644 |
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp |
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp |
@@ -562,18 +562,19 @@ GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkMWCRandom* random, |
bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffectRef** effect, |
GrTexture* texture) const { |
- bool ok = fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; |
- if (ok && effect) { |
- *effect = GrMatrixConvolutionEffect::Create(texture, |
- fKernelSize, |
- fKernel, |
- fGain, |
- fBias, |
- fTarget, |
- fTileMode, |
- fConvolveAlpha); |
+ if (!effect) { |
+ return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; |
} |
- return ok; |
+ SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE); |
+ *effect = GrMatrixConvolutionEffect::Create(texture, |
+ fKernelSize, |
+ fKernel, |
+ fGain, |
+ fBias, |
+ fTarget, |
+ fTileMode, |
+ fConvolveAlpha); |
+ return true; |
} |
/////////////////////////////////////////////////////////////////////////////// |