Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkPaintImageFilter.h
1 /*
2  * Copyright 2016 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 SkPaintImageFilter_DEFINED
9 #define SkPaintImageFilter_DEFINED
10 
11 #include "SkImageFilter.h"
12 #include "SkPaint.h"
13 
14 class SK_API SkPaintImageFilter : public SkImageFilter {
15 public:
25  static sk_sp<SkImageFilter> Make(const SkPaint& paint, const CropRect* cropRect = nullptr);
26 
27  bool affectsTransparentBlack() const override;
28 
29  SK_TO_STRING_OVERRIDE()
30  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPaintImageFilter)
31 
32 #ifdef SK_SUPPORT_LEGACY_IMAGEFILTER_PTR
33  static SkImageFilter* Create(const SkPaint& paint, const CropRect* rect = nullptr) {
34  return Make(paint, rect).release();
35  }
36 #endif
37 
38 protected:
39  void flatten(SkWriteBuffer&) const override;
40  sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
41  SkIPoint* offset) const override;
42 
43 private:
44  SkPaintImageFilter(const SkPaint& paint, const CropRect* rect);
45 
46  SkPaint fPaint;
47 
48  typedef SkImageFilter INHERITED;
49 };
50 
51 #endif
T *SK_WARN_UNUSED_RESULT release()
Return the bare pointer, and set the internal object pointer to nullptr.
Definition: SkRefCnt.h:363
Definition: SkImageFilter.h:55
Definition: SkPaintImageFilter.h:14
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: SkRefCnt.h:135
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:46
Base class for image filters.
Definition: SkImageFilter.h:35
Definition: SkWriteBuffer.h:26
Definition: SkImageFilter.h:37
SkIPoint holds two 32 bit integer coordinates.
Definition: SkPoint.h:40