1 | /* |
---|---|
2 | * Copyright 2013 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 SkXfermodeImageFilter_DEFINED |
9 | #define SkXfermodeImageFilter_DEFINED |
10 | |
11 | #include "include/core/SkBlendMode.h" |
12 | #include "include/core/SkImageFilter.h" |
13 | |
14 | /** |
15 | * This filter takes a SkBlendMode, and uses it to composite the foreground over the background. |
16 | * If foreground or background is NULL, the input bitmap (src) is used instead. |
17 | // DEPRECATED: Use include/effects/SkImageFilters::XferMode |
18 | */ |
19 | class SK_API SkXfermodeImageFilter { |
20 | public: |
21 | static sk_sp<SkImageFilter> Make(SkBlendMode, sk_sp<SkImageFilter> background, |
22 | sk_sp<SkImageFilter> foreground, |
23 | const SkImageFilter::CropRect* cropRect); |
24 | static sk_sp<SkImageFilter> Make(SkBlendMode mode, sk_sp<SkImageFilter> background) { |
25 | return Make(mode, std::move(background), nullptr, nullptr); |
26 | } |
27 | |
28 | static void RegisterFlattenables(); |
29 | |
30 | private: |
31 | SkXfermodeImageFilter(); // can't instantiate |
32 | }; |
33 | |
34 | #endif |
35 |