Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkMergeImageFilter.h
1 /*
2  * Copyright 2012 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 SkMergeImageFilter_DEFINED
9 #define SkMergeImageFilter_DEFINED
10 
11 #include "SkImageFilter.h"
12 
13 class SK_API SkMergeImageFilter : public SkImageFilter {
14 public:
15  static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter>* const filters, int count,
16  const CropRect* cropRect = nullptr);
17 
19  const CropRect* cropRect = nullptr) {
20  sk_sp<SkImageFilter> array[] = {
21  std::move(first),
22  std::move(second),
23  };
24  return Make(array, 2, cropRect);
25  }
26 
27  SK_TO_STRING_OVERRIDE()
28  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMergeImageFilter)
29 
30 protected:
31  void flatten(SkWriteBuffer&) const override;
32  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
33  SkIPoint* offset) const override;
34  sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
35  bool onCanHandleComplexCTM() const override { return true; }
36 
37 private:
38  SkMergeImageFilter(sk_sp<SkImageFilter>* const filters, int count, const CropRect* cropRect);
39 
40  typedef SkImageFilter INHERITED;
41 };
42 
43 #endif
Definition: SkImageFilter.h:76
void flatten(SkWriteBuffer &) const override
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
virtual sk_sp< SkSpecialImage > onFilterImage(SkSpecialImage *src, const Context &, SkIPoint *offset) const =0
This is the virtual which should be overridden by the derived class to perform image filtering...
Definition: SkMergeImageFilter.h:13
Base class for image filters.
Definition: SkImageFilter.h:36
Definition: SkWriteBuffer.h:27
bool onCanHandleComplexCTM() const override
Override this to describe the behavior of your subclass - as a leaf node.
Definition: SkMergeImageFilter.h:35
Definition: SkImageFilter.h:54
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40