blob: 6c43b6c68c50b862fb24e9f974427e79c51d178b [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com8a1c16f2008-12-17 15:59:43 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@android.com8a1c16f2008-12-17 15:59:43 +000010#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*/
ctguil@chromium.org7ffb1b22011-03-15 21:27:08 +000020class SK_API SkCornerPathEffect : public SkPathEffect {
reed@android.com8a1c16f2008-12-17 15:59:43 +000021public:
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.
reed@google.comfd4be262012-05-25 01:04:12 +000030 virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000031
djsollen@google.comba28d032012-03-26 17:57:35 +000032 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
reed@google.com6bac9472011-06-21 19:24:00 +000033
reed@android.com8a1c16f2008-12-17 15:59:43 +000034protected:
35 SkCornerPathEffect(SkFlattenableReadBuffer&);
djsollen@google.com54924242012-03-29 15:18:04 +000036 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000037
38private:
39 SkScalar fRadius;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000040
reed@android.com8a1c16f2008-12-17 15:59:43 +000041 typedef SkPathEffect INHERITED;
42};
43
44#endif
45