blob: ee89219f8543b8dd25c0e1d2711771e3a259f900 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00003 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00004 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00006 */
7
8#ifndef SkCornerPathEffect_DEFINED
9#define SkCornerPathEffect_DEFINED
10
11#include "SkPathEffect.h"
12
13/** \class SkCornerPathEffect
14
15 SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
16 into various treatments (e.g. rounded corners)
17*/
ctguil@chromium.org7ffb1b22011-03-15 21:27:08 +000018class SK_API SkCornerPathEffect : public SkPathEffect {
reed@android.com8a1c16f2008-12-17 15:59:43 +000019public:
20 /** radius must be > 0 to have an effect. It specifies the distance from each corner
21 that should be "rounded".
22 */
23 SkCornerPathEffect(SkScalar radius);
24 virtual ~SkCornerPathEffect();
25
reed@google.com548a1f32012-12-18 16:12:09 +000026 virtual bool filterPath(SkPath* dst, const SkPath& src,
27 SkStrokeRec*) const SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000028
djsollen@google.comba28d032012-03-26 17:57:35 +000029 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
reed@google.com6bac9472011-06-21 19:24:00 +000030
reed@android.com8a1c16f2008-12-17 15:59:43 +000031protected:
32 SkCornerPathEffect(SkFlattenableReadBuffer&);
djsollen@google.com54924242012-03-29 15:18:04 +000033 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000034
35private:
36 SkScalar fRadius;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000037
reed@android.com8a1c16f2008-12-17 15:59:43 +000038 typedef SkPathEffect INHERITED;
39};
40
41#endif