/* * Copyright 2012 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMergeImageFilter_DEFINED #define SkMergeImageFilter_DEFINED #include "SkFlattenable.h" #include "SkImageFilter.h" class SK_API SkMergeImageFilter : public SkImageFilter { public: static sk_sp Make(sk_sp* const filters, int count, const CropRect* cropRect = nullptr); static sk_sp Make(sk_sp first, sk_sp second, const CropRect* cropRect = nullptr) { sk_sp array[] = { std::move(first), std::move(second), }; return Make(array, 2, cropRect); } protected: void flatten(SkWriteBuffer&) const override; sk_sp onFilterImage(SkSpecialImage* source, const Context&, SkIPoint* offset) const override; sk_sp onMakeColorSpace(SkColorSpaceXformer*) const override; bool onCanHandleComplexCTM() const override { return true; } private: SK_FLATTENABLE_HOOKS(SkMergeImageFilter) SkMergeImageFilter(sk_sp* const filters, int count, const CropRect* cropRect); typedef SkImageFilter INHERITED; }; #endif