Skia
2DGraphicsLibrary
 All Classes Namespaces 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 protected:
23  explicit SkComposeImageFilter(sk_sp<SkImageFilter> inputs[2]) : INHERITED(inputs, 2, nullptr) {
24  SkASSERT(inputs[0].get());
25  SkASSERT(inputs[1].get());
26  }
27  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
28  SkIPoint* offset) const override;
29  sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
30  SkIRect onFilterBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
31  bool onCanHandleComplexCTM() const override { return true; }
32 
33 private:
34  typedef SkImageFilter INHERITED;
35 };
36 
37 #endif
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:28
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:125
Base class for image filters.
Definition: SkImageFilter.h:36
bool onCanHandleComplexCTM() const override
Override this to describe the behavior of your subclass - as a leaf node.
Definition: SkComposeImageFilter.h:31
Definition: SkRect.h:404
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:54
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