[svg] Several filter helper tweaks

- Allow resolving inputs without modifying their colorspace
- Add helper to get the colorspace of a particular input
- Make resolveColorspace() virtual and add filter context to its
  signature

Bug: skia:10841
Change-Id: I2e226ec26205f527c2d171140072f106ec35fbe0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356416
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
diff --git a/modules/svg/src/SkSVGFeMorphology.cpp b/modules/svg/src/SkSVGFeMorphology.cpp
index 2489a5b..67310c8 100644
--- a/modules/svg/src/SkSVGFeMorphology.cpp
+++ b/modules/svg/src/SkSVGFeMorphology.cpp
@@ -23,7 +23,7 @@
 sk_sp<SkImageFilter> SkSVGFeMorphology::onMakeImageFilter(const SkSVGRenderContext& ctx,
                                                           const SkSVGFilterContext& fctx) const {
     const SkRect cropRect = this->resolveFilterSubregion(ctx, fctx);
-    const SkSVGColorspace colorspace = this->resolveColorspace(ctx);
+    const SkSVGColorspace colorspace = this->resolveColorspace(ctx, fctx);
     sk_sp<SkImageFilter> input = fctx.resolveInput(ctx, this->getIn(), colorspace);
 
     SkScalar rx = fRadius.fX;