2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkCornerPathEffect_DEFINED
|
|
|
|
#define SkCornerPathEffect_DEFINED
|
|
|
|
|
|
|
|
#include "SkPathEffect.h"
|
|
|
|
|
|
|
|
/** \class SkCornerPathEffect
|
|
|
|
|
|
|
|
SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
|
|
|
|
into various treatments (e.g. rounded corners)
|
|
|
|
*/
|
2011-03-15 21:27:08 +00:00
|
|
|
class SK_API SkCornerPathEffect : public SkPathEffect {
|
2008-12-17 15:59:43 +00:00
|
|
|
public:
|
|
|
|
/** radius must be > 0 to have an effect. It specifies the distance from each corner
|
|
|
|
that should be "rounded".
|
|
|
|
*/
|
2014-02-20 20:40:19 +00:00
|
|
|
static SkCornerPathEffect* Create(SkScalar radius) {
|
|
|
|
return SkNEW_ARGS(SkCornerPathEffect, (radius));
|
|
|
|
}
|
2008-12-17 15:59:43 +00:00
|
|
|
virtual ~SkCornerPathEffect();
|
|
|
|
|
2012-12-18 16:12:09 +00:00
|
|
|
virtual bool filterPath(SkPath* dst, const SkPath& src,
|
2013-01-24 21:03:11 +00:00
|
|
|
SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2012-03-26 17:57:35 +00:00
|
|
|
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect)
|
2011-06-21 19:24:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
protected:
|
2014-01-30 18:58:24 +00:00
|
|
|
SkCornerPathEffect(SkReadBuffer&);
|
|
|
|
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2014-02-20 20:40:19 +00:00
|
|
|
#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
|
|
|
|
public:
|
|
|
|
#endif
|
|
|
|
SkCornerPathEffect(SkScalar radius);
|
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
private:
|
|
|
|
SkScalar fRadius;
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
typedef SkPathEffect INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|