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 "SkArithmeticImageFilter.h" 12 #include "SkBlendMode.h" 13 #include "SkImageFilter.h" 14 15 /** 16 * This filter takes a SkBlendMode, and uses it to composite the foreground over the background. 17 * If foreground or background is NULL, the input bitmap (src) is used instead. 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); Make(SkBlendMode mode,sk_sp<SkImageFilter> background)24 static sk_sp<SkImageFilter> Make(SkBlendMode mode, sk_sp<SkImageFilter> background) { 25 return Make(mode, std::move(background), nullptr, nullptr); 26 } 27 28 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP(); 29 30 private: 31 SkXfermodeImageFilter(); // can't instantiate 32 }; 33 34 #endif 35