SkCornerPathEffect.h revision 54924243c1b65b3ee6d8fa064b50a9b1bb2a19a5
1
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10#ifndef SkCornerPathEffect_DEFINED
11#define SkCornerPathEffect_DEFINED
12
13#include "SkPathEffect.h"
14
15/** \class SkCornerPathEffect
16
17    SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
18    into various treatments (e.g. rounded corners)
19*/
20class SK_API SkCornerPathEffect : public SkPathEffect {
21public:
22    /** radius must be > 0 to have an effect. It specifies the distance from each corner
23        that should be "rounded".
24    */
25    SkCornerPathEffect(SkScalar radius);
26    virtual ~SkCornerPathEffect();
27
28    // overrides for SkPathEffect
29    //  This method is not exported to java.
30    virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
31
32    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
33
34protected:
35    SkCornerPathEffect(SkFlattenableReadBuffer&);
36    virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
37
38private:
39    SkScalar    fRadius;
40
41    typedef SkPathEffect INHERITED;
42};
43
44#endif
45
46