Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkArcToPathEffect.h
1 /*
2  * Copyright 2014 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 SkArcToPathEffect_DEFINED
9 #define SkArcToPathEffect_DEFINED
10 
11 #include "SkPathEffect.h"
12 
13 class SK_API SkArcToPathEffect : public SkPathEffect {
14 public:
18  static sk_sp<SkPathEffect> Make(SkScalar radius) {
19  if (radius <= 0) {
20  return NULL;
21  }
22  return sk_sp<SkPathEffect>(new SkArcToPathEffect(radius));
23  }
24 
25  bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override;
26 
27  SK_TO_STRING_OVERRIDE()
28  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArcToPathEffect)
29 
30 protected:
31  explicit SkArcToPathEffect(SkScalar radius);
32  void flatten(SkWriteBuffer&) const override;
33 
34 private:
35  SkScalar fRadius;
36 
37  typedef SkPathEffect INHERITED;
38 };
39 
40 #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
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...
static sk_sp< SkPathEffect > Make(SkScalar radius)
radius must be > 0 to have an effect.
Definition: SkArcToPathEffect.h:18
Definition: SkWriteBuffer.h:27
Definition: SkRect.h:404
Definition: SkArcToPathEffect.h:13