SkCornerPathEffect.h revision d26147adbbdca85f07dff432025afee0c8614387
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    // overrides for SkFlattenable
33    //  This method is not exported to java.
34    virtual Factory getFactory();
35    //  This method is not exported to java.
36    virtual void flatten(SkFlattenableWriteBuffer&);
37
38    static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
39
40    SK_DECLARE_FLATTENABLE_REGISTRAR()
41
42protected:
43    SkCornerPathEffect(SkFlattenableReadBuffer&);
44
45private:
46    SkScalar    fRadius;
47
48    typedef SkPathEffect INHERITED;
49};
50
51#endif
52
53