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: |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 17 | static SkImageFilter* Create(const SkRect& src, SkScalar inset, SkImageFilter* input = NULL); |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 18 | |
robertphillips | f3f5bad | 2014-12-19 13:49:15 -0800 | [diff] [blame] | 19 | SK_TO_STRING_OVERRIDE() |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 20 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) |
| 21 | |
| 22 | protected: |
senorblanco | 9ea3d57 | 2014-07-08 09:16:22 -0700 | [diff] [blame] | 23 | SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input); |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 24 | void flatten(SkWriteBuffer&) const override; |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 25 | |
robertphillips | 48e7846 | 2016-02-17 13:57:16 -0800 | [diff] [blame^] | 26 | bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
| 27 | SkBitmap* result, SkIPoint* offset) const override; |
senorblanco@chromium.org | 1aa6872 | 2013-10-17 19:35:09 +0000 | [diff] [blame] | 28 | #if SK_SUPPORT_GPU |
bsalomon | 4a33952 | 2015-10-06 08:40:50 -0700 | [diff] [blame] | 29 | bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, |
| 30 | const SkIRect& bounds) const override; |
senorblanco@chromium.org | 1aa6872 | 2013-10-17 19:35:09 +0000 | [diff] [blame] | 31 | #endif |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 32 | |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 33 | private: |
| 34 | SkRect fSrcRect; |
| 35 | SkScalar fInset; |
| 36 | typedef SkImageFilter INHERITED; |
| 37 | }; |
| 38 | |
| 39 | #endif |