senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +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 | #ifndef SkOffsetImageFilter_DEFINED |
| 9 | #define SkOffsetImageFilter_DEFINED |
| 10 | |
senorblanco@chromium.org | 377c14a | 2013-02-04 22:57:21 +0000 | [diff] [blame] | 11 | #include "SkImageFilter.h" |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 12 | #include "SkPoint.h" |
| 13 | |
senorblanco@chromium.org | 377c14a | 2013-02-04 22:57:21 +0000 | [diff] [blame] | 14 | class SK_API SkOffsetImageFilter : public SkImageFilter { |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 15 | public: |
robertphillips | 51a315e | 2016-03-31 09:05:49 -0700 | [diff] [blame] | 16 | static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, |
| 17 | sk_sp<SkImageFilter> input, |
robertphillips | 225db44 | 2016-04-17 14:27:05 -0700 | [diff] [blame] | 18 | const CropRect* cropRect = nullptr); |
reed | 5ea95df | 2015-10-06 14:05:32 -0700 | [diff] [blame] | 19 | |
senorblanco | e5e7984 | 2016-03-21 14:51:59 -0700 | [diff] [blame] | 20 | SkRect computeFastBounds(const SkRect& src) const override; |
reed | 5ea95df | 2015-10-06 14:05:32 -0700 | [diff] [blame] | 21 | |
robertphillips | f3f5bad | 2014-12-19 13:49:15 -0800 | [diff] [blame] | 22 | SK_TO_STRING_OVERRIDE() |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 23 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) |
| 24 | |
| 25 | protected: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 26 | void flatten(SkWriteBuffer&) const override; |
robertphillips | 2302de9 | 2016-03-24 07:26:32 -0700 | [diff] [blame] | 27 | sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, |
| 28 | SkIPoint* offset) const override; |
Matt Sarett | 6d72ed9 | 2017-04-10 16:35:33 -0400 | [diff] [blame^] | 29 | sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override; |
senorblanco | e5e7984 | 2016-03-21 14:51:59 -0700 | [diff] [blame] | 30 | SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override; |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 31 | |
| 32 | private: |
robertphillips | 51a315e | 2016-03-31 09:05:49 -0700 | [diff] [blame] | 33 | SkOffsetImageFilter(SkScalar dx, SkScalar dy, sk_sp<SkImageFilter> input, const CropRect*); |
reed | 5ea95df | 2015-10-06 14:05:32 -0700 | [diff] [blame] | 34 | |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 35 | SkVector fOffset; |
reed | 5ea95df | 2015-10-06 14:05:32 -0700 | [diff] [blame] | 36 | |
| 37 | typedef SkImageFilter INHERITED; |
senorblanco@chromium.org | 9daf96a | 2012-11-06 20:29:39 +0000 | [diff] [blame] | 38 | }; |
| 39 | |
| 40 | #endif |