SkCornerPathEffect.h revision ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976e
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
40protected:
41    SkCornerPathEffect(SkFlattenableReadBuffer&);
42
43private:
44    SkScalar    fRadius;
45
46    typedef SkPathEffect INHERITED;
47};
48
49#endif
50
51