Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkDiscretePathEffect.h
1 /*
2  * Copyright 2006 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 SkDiscretePathEffect_DEFINED
9 #define SkDiscretePathEffect_DEFINED
10 
11 #include "SkPathEffect.h"
12 
17 class SK_API SkDiscretePathEffect : public SkPathEffect {
18 public:
32  static sk_sp<SkPathEffect> Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist = 0);
33 
34  virtual bool filterPath(SkPath* dst, const SkPath& src,
35  SkStrokeRec*, const SkRect*) const override;
36 
37  SK_TO_STRING_OVERRIDE()
38  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiscretePathEffect)
39 
40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
41  bool exposedInAndroidJavaAPI() const override { return true; }
42 #endif
43 
44 protected:
45  SkDiscretePathEffect(SkScalar segLength,
46  SkScalar deviation,
47  uint32_t seedAssist);
48  void flatten(SkWriteBuffer&) const override;
49 
50 private:
51  SkScalar fSegLength, fPerterb;
52 
53  /* Caller-supplied 32 bit seed assist */
54  uint32_t fSeedAssist;
55 
56  typedef SkPathEffect INHERITED;
57 };
58 
59 #endif
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:25
SkPathEffect is the base class for objects in the SkPaint that affect the geometry of a drawing primi...
Definition: SkPathEffect.h:27
Definition: SkStrokeRec.h:16
Definition: SkRefCnt.h:125
virtual bool filterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR) const =0
Given a src path (input) and a stroke-rec (input and output), apply this effect to the src path...
This path effect chops a path into discrete segments, and randomly displaces them.
Definition: SkDiscretePathEffect.h:17
Definition: SkWriteBuffer.h:27
Definition: SkRect.h:404
virtual void flatten(SkWriteBuffer &) const
Override this if your subclass needs to record data that it will need to recreate itself from its Cre...
Definition: SkFlattenable.h:117