blob: 978c07ecbee07cab2e7368170d2aebe92fd81db4 [file] [log] [blame]
* 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 {
static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter>* const filters, int count,
const CropRect* cropRect = nullptr);
static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> first, sk_sp<SkImageFilter> second,
const CropRect* cropRect = nullptr) {
sk_sp<SkImageFilter> array[] = {
return Make(array, 2, cropRect);
Factory getFactory() const override { return CreateProc; }
void flatten(SkWriteBuffer&) const override;
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
SkIPoint* offset) const override;
sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
bool onCanHandleComplexCTM() const override { return true; }
SkMergeImageFilter(sk_sp<SkImageFilter>* const filters, int count, const CropRect* cropRect);
static sk_sp<SkFlattenable> CreateProc(SkReadBuffer&);
friend class SkFlattenable::PrivateInitializer;
typedef SkImageFilter INHERITED;