From 6d72ed918d8763e65899183c2d12b06958c791f4 Mon Sep 17 00:00:00 2001 From: Matt Sarett Date: Mon, 10 Apr 2017 16:35:33 -0400 Subject: SkImageFilter::onMakeColorSpace() - more overrides Fills out most of the simple implementations. Improves 22 gms in gbr-8888. Bug: skia: Change-Id: I881ade140993568263de75be51aed240d2de8cc6 Reviewed-on: https://skia-review.googlesource.com/13126 Commit-Queue: Matt Sarett Reviewed-by: Mike Klein --- src/effects/SkAlphaThresholdFilter.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/effects/SkAlphaThresholdFilter.cpp') diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index cf3896dee6..35328d5227 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -37,8 +37,10 @@ protected: sk_sp onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; + sk_sp onMakeColorSpace(SkColorSpaceXformer*) const override; + #if SK_SUPPORT_GPU - sk_sp createMaskTexture(GrContext*, + sk_sp createMaskTexture(GrContext*, const SkMatrix&, const SkIRect& bounds) const; #endif @@ -262,6 +264,18 @@ sk_sp SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage* dst); } +sk_sp SkAlphaThresholdFilterImpl::onMakeColorSpace(SkColorSpaceXformer* xformer) +const { + SkASSERT(1 == this->countInputs()); + if (!this->getInput(0)) { + return sk_ref_sp(const_cast(this)); + } + + sk_sp input = this->getInput(0)->makeColorSpace(xformer); + return SkAlphaThresholdFilter::Make(fRegion, fInnerThreshold, fOuterThreshold, + std::move(input), this->getCropRectIfSet()); +} + #ifndef SK_IGNORE_TO_STRING void SkAlphaThresholdFilterImpl::toString(SkString* str) const { str->appendf("SkAlphaThresholdImageFilter: ("); -- cgit v1.2.3