ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 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 SkPaintImageFilter_DEFINED |
| 9 | #define SkPaintImageFilter_DEFINED |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkImageFilter.h" |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 12 | |
Michael Ludwig | d668f7f | 2019-07-30 10:03:16 -0400 | [diff] [blame] | 13 | class SkPaint; |
| 14 | |
Michael Ludwig | 06eacf4 | 2019-08-01 16:02:27 -0400 | [diff] [blame] | 15 | // DEPRECATED: Use include/effects/SkImageFilters::Paint |
Michael Ludwig | d668f7f | 2019-07-30 10:03:16 -0400 | [diff] [blame] | 16 | class SK_API SkPaintImageFilter { |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 17 | public: |
| 18 | /** Create a new image filter which fills the given rectangle using the |
| 19 | * given paint. If no rectangle is specified, an output is produced with |
| 20 | * the same bounds as the input primitive (even though the input |
| 21 | * primitive's pixels are not used for processing). |
| 22 | * @param paint Paint to use when filling the rect. |
| 23 | * @param rect Rectangle of output pixels. If NULL or a given crop edge is |
| 24 | * not specified, the source primitive's bounds are used |
| 25 | * instead. |
| 26 | */ |
Michael Ludwig | d668f7f | 2019-07-30 10:03:16 -0400 | [diff] [blame] | 27 | static sk_sp<SkImageFilter> Make(const SkPaint& paint, |
| 28 | const SkImageFilter::CropRect* cropRect = nullptr); |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 29 | |
Michael Ludwig | d668f7f | 2019-07-30 10:03:16 -0400 | [diff] [blame] | 30 | static void RegisterFlattenables(); |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 31 | |
| 32 | private: |
Michael Ludwig | d668f7f | 2019-07-30 10:03:16 -0400 | [diff] [blame] | 33 | SkPaintImageFilter() = delete; |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | #endif |