blob: a44df0a1a830410f249491d760fd1d616afbb527 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SkCornerPathEffect_DEFINED
18#define SkCornerPathEffect_DEFINED
19
20#include "SkPathEffect.h"
21
22/** \class SkCornerPathEffect
23
24 SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
25 into various treatments (e.g. rounded corners)
26*/
ctguil@chromium.org7ffb1b22011-03-15 21:27:08 +000027class SK_API SkCornerPathEffect : public SkPathEffect {
reed@android.com8a1c16f2008-12-17 15:59:43 +000028public:
29 /** radius must be > 0 to have an effect. It specifies the distance from each corner
30 that should be "rounded".
31 */
32 SkCornerPathEffect(SkScalar radius);
33 virtual ~SkCornerPathEffect();
34
35 // overrides for SkPathEffect
36 // This method is not exported to java.
37 virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width);
38
39 // overrides for SkFlattenable
40 // This method is not exported to java.
41 virtual Factory getFactory();
42 // This method is not exported to java.
43 virtual void flatten(SkFlattenableWriteBuffer&);
44
reed@google.com6bac9472011-06-21 19:24:00 +000045 static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
46
reed@android.com8a1c16f2008-12-17 15:59:43 +000047protected:
48 SkCornerPathEffect(SkFlattenableReadBuffer&);
49
50private:
51 SkScalar fRadius;
reed@android.com8a1c16f2008-12-17 15:59:43 +000052
53 typedef SkPathEffect INHERITED;
54};
55
56#endif
57