blob: ca8819c59f2052c79df43ae2b93a7b108aa3d234 [file] [log] [blame]
reed8b575242014-12-17 01:47:32 -08001/*
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
13class SK_API SkArcToPathEffect : public SkPathEffect {
14public:
15 /** radius must be > 0 to have an effect. It specifies the distance from each corner
16 that should be "rounded".
17 */
18 static SkPathEffect* Create(SkScalar radius) {
19 if (radius <= 0) {
20 return NULL;
21 }
22 return SkNEW_ARGS(SkArcToPathEffect, (radius));
23 }
24
25 bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
26
27 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArcToPathEffect)
28
29protected:
30 explicit SkArcToPathEffect(SkScalar radius);
mtklein72c9faa2015-01-09 10:06:39 -080031 void flatten(SkWriteBuffer&) const SK_OVERRIDE;
reed8b575242014-12-17 01:47:32 -080032
33private:
34 SkScalar fRadius;
35
36 typedef SkPathEffect INHERITED;
37};
38
39#endif