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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.cpp

Issue 13602013: Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This w… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix return value of SkImageFilter::asNewEffect(). Created 7 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
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;
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698