diff options
Diffstat (limited to 'src/effects/SkMatrixConvolutionImageFilter.cpp')
-rw-r--r-- | src/effects/SkMatrixConvolutionImageFilter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index e92f07247b..b94ece514d 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -8,6 +8,7 @@ #include "SkMatrixConvolutionImageFilter.h" #include "SkBitmap.h" #include "SkColorPriv.h" +#include "SkColorSpaceXformer.h" #include "SkReadBuffer.h" #include "SkSpecialImage.h" #include "SkWriteBuffer.h" @@ -384,14 +385,14 @@ sk_sp<SkSpecialImage> SkMatrixConvolutionImageFilter::onFilterImage(SkSpecialIma sk_sp<SkImageFilter> SkMatrixConvolutionImageFilter::onMakeColorSpace(SkColorSpaceXformer* xformer) const { SkASSERT(1 == this->countInputs()); - if (!this->getInput(0)) { - return sk_ref_sp(const_cast<SkMatrixConvolutionImageFilter*>(this)); - } - sk_sp<SkImageFilter> input = this->getInput(0)->makeColorSpace(xformer); - return SkMatrixConvolutionImageFilter::Make(fKernelSize, fKernel, fGain, fBias, fKernelOffset, - fTileMode, fConvolveAlpha, std::move(input), - this->getCropRectIfSet()); + sk_sp<SkImageFilter> input = xformer->apply(this->getInput(0)); + if (input.get() != this->getInput(0)) { + return SkMatrixConvolutionImageFilter::Make(fKernelSize, fKernel, fGain, fBias, + fKernelOffset, fTileMode, fConvolveAlpha, + std::move(input), this->getCropRectIfSet()); + } + return this->refMe(); } SkIRect SkMatrixConvolutionImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, |