Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkComposeImageFilter.h
1 /*
2  * Copyright 2013 Google Inc.
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 SkComposeImageFilter_DEFINED
9 #define SkComposeImageFilter_DEFINED
10 
11 #include "SkImageFilter.h"
12 
13 class SK_API SkComposeImageFilter : public SkImageFilter {
14 public:
16 
17  SkRect computeFastBounds(const SkRect& src) const override;
18 
19  SK_TO_STRING_OVERRIDE()
20  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeImageFilter)
21 
22 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
23  static SkImageFilter* Create(SkImageFilter* outer, SkImageFilter* inner) {
24  return Make(sk_ref_sp<SkImageFilter>(outer),
25  sk_ref_sp<SkImageFilter>(inner)).release();
26  }
27 #endif
28 
29 protected:
30  explicit SkComposeImageFilter(sk_sp<SkImageFilter> inputs[2]) : INHERITED(inputs, 2, nullptr) {
31  SkASSERT(inputs[0].get());
32  SkASSERT(inputs[1].get());
33  }
34  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
35  SkIPoint* offset) const override;
36  SkIRect onFilterBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
37  bool onCanHandleComplexCTM() const override { return true; }
38 
39 private:
40  typedef SkImageFilter INHERITED;
41 };
42 
43 #endif
T *SK_WARN_UNUSED_RESULT release()
Return the bare pointer, and set the internal object pointer to nullptr.
Definition: SkRefCnt.h:363
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:26
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: SkRefCnt.h:135
Base class for image filters.
Definition: SkImageFilter.h:35
bool onCanHandleComplexCTM() const override
Override this to describe the behavior of your subclass - as a leaf node.
Definition: SkComposeImageFilter.h:37
Definition: SkRect.h:390
Definition: SkComposeImageFilter.h:13
virtual SkIRect onFilterBounds(const SkIRect &, const SkMatrix &, MapDirection) const
This function recurses into its inputs with the given rect (first argument), calls filterBounds() wit...
Definition: SkImageFilter.h:37
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40