Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkTileImageFilter.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 SkTileImageFilter_DEFINED
9 #define SkTileImageFilter_DEFINED
10 
11 #include "SkImageFilter.h"
12 
13 class SK_API SkTileImageFilter : public SkImageFilter {
14 public:
20  static sk_sp<SkImageFilter> Make(const SkRect& src,
21  const SkRect& dst,
22  sk_sp<SkImageFilter> input);
23 
24  SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
25  SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
26  SkRect computeFastBounds(const SkRect& src) const override;
27 
28  SK_TO_STRING_OVERRIDE()
29  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)
30 
31 protected:
32  void flatten(SkWriteBuffer& buffer) const override;
33 
34  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
35  SkIPoint* offset) const override;
36  sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
37 
38 private:
39  SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, sk_sp<SkImageFilter> input)
40  : INHERITED(&input, 1, nullptr), fSrcRect(srcRect), fDstRect(dstRect) {}
41 
42  SkRect fSrcRect;
43  SkRect fDstRect;
44 
45  typedef SkImageFilter INHERITED;
46 };
47 
48 #endif
void flatten(SkWriteBuffer &) const override
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
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
Definition: SkTileImageFilter.h:13
Definition: SkWriteBuffer.h:27
Definition: SkRect.h:404
virtual SkIRect onFilterNodeBounds(const SkIRect &, const SkMatrix &, MapDirection) const
Performs a forwards or reverse mapping of the given rect to accommodate this filter's margin requirem...
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