diff options
author | Matt Sarett <msarett@google.com> | 2017-04-10 16:35:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-10 21:28:43 +0000 |
commit | 6d72ed918d8763e65899183c2d12b06958c791f4 (patch) | |
tree | 0ae05fc489d85aed6f0f928680533fc7d15e1540 /src/effects/SkAlphaThresholdFilter.cpp | |
parent | 67cadde35b9fceef49c332ce892d025c576b5983 (diff) |
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 <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/effects/SkAlphaThresholdFilter.cpp')
-rw-r--r-- | src/effects/SkAlphaThresholdFilter.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; + sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; + #if SK_SUPPORT_GPU - sk_sp<GrTextureProxy> createMaskTexture(GrContext*, + sk_sp<GrTextureProxy> createMaskTexture(GrContext*, const SkMatrix&, const SkIRect& bounds) const; #endif @@ -262,6 +264,18 @@ sk_sp<SkSpecialImage> SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage* dst); } +sk_sp<SkImageFilter> SkAlphaThresholdFilterImpl::onMakeColorSpace(SkColorSpaceXformer* xformer) +const { + SkASSERT(1 == this->countInputs()); + if (!this->getInput(0)) { + return sk_ref_sp(const_cast<SkAlphaThresholdFilterImpl*>(this)); + } + + sk_sp<SkImageFilter> 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: ("); |