bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | |
| 9 | #ifndef SkMagnifierImageFilter_DEFINED |
| 10 | #define SkMagnifierImageFilter_DEFINED |
| 11 | |
| 12 | #include "SkRect.h" |
| 13 | #include "SkImageFilter.h" |
| 14 | |
| 15 | class SK_API SkMagnifierImageFilter : public SkImageFilter { |
| 16 | public: |
Robert Phillips | 8e1c4e6 | 2017-02-19 12:27:01 -0500 | [diff] [blame] | 17 | static sk_sp<SkImageFilter> Make(const SkRect& srcRect, SkScalar inset, |
robertphillips | b2a4dc6 | 2016-04-14 07:54:04 -0700 | [diff] [blame] | 18 | sk_sp<SkImageFilter> input, |
| 19 | const CropRect* cropRect = nullptr); |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 20 | |
robertphillips | f3f5bad | 2014-12-19 13:49:15 -0800 | [diff] [blame] | 21 | SK_TO_STRING_OVERRIDE() |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 22 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) |
| 23 | |
| 24 | protected: |
robertphillips | b2a4dc6 | 2016-04-14 07:54:04 -0700 | [diff] [blame] | 25 | SkMagnifierImageFilter(const SkRect& srcRect, |
| 26 | SkScalar inset, |
| 27 | sk_sp<SkImageFilter> input, |
| 28 | const CropRect* cropRect); |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 29 | void flatten(SkWriteBuffer&) const override; |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 30 | |
robertphillips | b2a4dc6 | 2016-04-14 07:54:04 -0700 | [diff] [blame] | 31 | sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, |
| 32 | SkIPoint* offset) const override; |
Matt Sarett | 6d72ed9 | 2017-04-10 16:35:33 -0400 | [diff] [blame^] | 33 | sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 34 | |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 35 | private: |
Robert Phillips | 8e1c4e6 | 2017-02-19 12:27:01 -0500 | [diff] [blame] | 36 | SkRect fSrcRect; |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 37 | SkScalar fInset; |
Robert Phillips | 8e1c4e6 | 2017-02-19 12:27:01 -0500 | [diff] [blame] | 38 | |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 39 | typedef SkImageFilter INHERITED; |
| 40 | }; |
| 41 | |
| 42 | #endif |