michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkCornerPathEffect_DEFINED michael@0: #define SkCornerPathEffect_DEFINED michael@0: michael@0: #include "SkPathEffect.h" michael@0: michael@0: /** \class SkCornerPathEffect michael@0: michael@0: SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners michael@0: into various treatments (e.g. rounded corners) michael@0: */ michael@0: class SK_API SkCornerPathEffect : public SkPathEffect { michael@0: public: michael@0: /** radius must be > 0 to have an effect. It specifies the distance from each corner michael@0: that should be "rounded". michael@0: */ michael@0: static SkCornerPathEffect* Create(SkScalar radius) { michael@0: return SkNEW_ARGS(SkCornerPathEffect, (radius)); michael@0: } michael@0: virtual ~SkCornerPathEffect(); michael@0: michael@0: virtual bool filterPath(SkPath* dst, const SkPath& src, michael@0: SkStrokeRec*, const SkRect*) const SK_OVERRIDE; michael@0: michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkCornerPathEffect) michael@0: michael@0: protected: michael@0: SkCornerPathEffect(SkReadBuffer&); michael@0: virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; michael@0: michael@0: #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS michael@0: public: michael@0: #endif michael@0: SkCornerPathEffect(SkScalar radius); michael@0: michael@0: private: michael@0: SkScalar fRadius; michael@0: michael@0: typedef SkPathEffect INHERITED; michael@0: }; michael@0: michael@0: #endif