Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkCornerPathEffect.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 SkCornerPathEffect_DEFINED
9 #define SkCornerPathEffect_DEFINED
10 
11 #include "SkPathEffect.h"
12 
18 class SK_API SkCornerPathEffect : public SkPathEffect {
19 public:
23  static sk_sp<SkPathEffect> Make(SkScalar radius) {
24  return sk_sp<SkPathEffect>(new SkCornerPathEffect(radius));
25  }
26 
27 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR
28  static SkPathEffect* Create(SkScalar radius) {
29  return Make(radius).release();
30  }
31 #endif
32 
33  virtual bool filterPath(SkPath* dst, const SkPath& src,
34  SkStrokeRec*, const SkRect*) const override;
35 
36  SK_TO_STRING_OVERRIDE()
37  SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
38 
39 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
40  bool exposedInAndroidJavaAPI() const override { return true; }
41 #endif
42 
43 protected:
44  virtual ~SkCornerPathEffect();
45 
46  explicit SkCornerPathEffect(SkScalar radius);
47  void flatten(SkWriteBuffer&) const override;
48 
49 private:
50  SkScalar fRadius;
51 
52  typedef SkPathEffect INHERITED;
53 };
54 
55 #endif
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:27
SkPathEffect is the base class for objects in the SkPaint that affect the geometry of a drawing primi...
Definition: SkPathEffect.h:29
Definition: SkStrokeRec.h:16
SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners into various treatments ...
Definition: SkCornerPathEffect.h:18
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...
Definition: SkWriteBuffer.h:26
Definition: SkRect.h:390
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
static sk_sp< SkPathEffect > Make(SkScalar radius)
radius must be > 0 to have an effect.
Definition: SkCornerPathEffect.h:23