blob: 9430bc4ebf9ee54588329fa9238d3f4824053f14 [file] [log] [blame]
ajuma77b6ba32016-01-08 14:58:35 -08001/*
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 Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkImageFilter.h"
ajuma77b6ba32016-01-08 14:58:35 -080012
Michael Ludwigd668f7f2019-07-30 10:03:16 -040013class SkPaint;
14
Michael Ludwig06eacf42019-08-01 16:02:27 -040015// DEPRECATED: Use include/effects/SkImageFilters::Paint
Michael Ludwigd668f7f2019-07-30 10:03:16 -040016class SK_API SkPaintImageFilter {
ajuma77b6ba32016-01-08 14:58:35 -080017public:
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 Ludwigd668f7f2019-07-30 10:03:16 -040027 static sk_sp<SkImageFilter> Make(const SkPaint& paint,
28 const SkImageFilter::CropRect* cropRect = nullptr);
ajuma77b6ba32016-01-08 14:58:35 -080029
Michael Ludwigd668f7f2019-07-30 10:03:16 -040030 static void RegisterFlattenables();
ajuma77b6ba32016-01-08 14:58:35 -080031
32private:
Michael Ludwigd668f7f2019-07-30 10:03:16 -040033 SkPaintImageFilter() = delete;
ajuma77b6ba32016-01-08 14:58:35 -080034};
35
36#endif