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

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: Remove SkSinglePassImageFilter class; move impl into SkImageFilter::filterImageGPU(). 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..b22dcb01bc0c0d52b974355d3f88485fd4754e5b 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -560,20 +560,20 @@ GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkMWCRandom* random,
convolveAlpha);
}
-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);
- }
- return ok;
+bool SkMatrixConvolutionImageFilter::canFilterImageGPU() const {
+ return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
+}
+
+GrEffectRef* SkMatrixConvolutionImageFilter::asNewEffect(GrTexture* texture) const {
+ SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE);
+ return GrMatrixConvolutionEffect::Create(texture,
+ fKernelSize,
+ fKernel,
+ fGain,
+ fBias,
+ fTarget,
+ fTileMode,
+ fConvolveAlpha);
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698