diff options
author | robertphillips <robertphillips@google.com> | 2016-04-14 07:54:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-14 07:54:04 -0700 |
commit | b2a4dc6a350abe3b18ecac719e499600f739a6e2 (patch) | |
tree | a5a0c8972a01a729c1103ffeba17a21b681647a3 /include/effects/SkMagnifierImageFilter.h | |
parent | e34635dee169b8710141d6d0841db1e2bde9626b (diff) |
Switch SkMagnifierImageFilter over to new onFilterImage interface
Additionally, this CL:
adds crop handling to the CPU path (the GPU path handled it but with a bug)
adds a cropRect (to better justify the applyCropRect)
adds a GM to exercise the cropRect
Note: I believe the handling of cropRects and clipping is deeply flawed but, at least, the two paths are consistently flawed now.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1882943002
Review URL: https://codereview.chromium.org/1882943002
Diffstat (limited to 'include/effects/SkMagnifierImageFilter.h')
-rw-r--r-- | include/effects/SkMagnifierImageFilter.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h index 739f1eec73..6e20297ff4 100644 --- a/include/effects/SkMagnifierImageFilter.h +++ b/include/effects/SkMagnifierImageFilter.h @@ -14,7 +14,9 @@ class SK_API SkMagnifierImageFilter : public SkImageFilter { public: - static sk_sp<SkImageFilter> Make(const SkRect& src, SkScalar inset, sk_sp<SkImageFilter> input); + static sk_sp<SkImageFilter> Make(const SkRect& src, SkScalar inset, + sk_sp<SkImageFilter> input, + const CropRect* cropRect = nullptr); SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) @@ -27,15 +29,14 @@ public: #endif protected: - SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, sk_sp<SkImageFilter> input); + SkMagnifierImageFilter(const SkRect& srcRect, + SkScalar inset, + sk_sp<SkImageFilter> input, + const CropRect* cropRect); void flatten(SkWriteBuffer&) const override; - bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, - SkBitmap* result, SkIPoint* offset) const override; -#if SK_SUPPORT_GPU - bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, - const SkIRect& bounds) const override; -#endif + sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, + SkIPoint* offset) const override; private: SkRect fSrcRect; |