Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Protected Member Functions | Private Member Functions | List of all members
Sk1DPathEffect Class Referenceabstract
Inheritance diagram for Sk1DPathEffect:
SkPathEffectBase SkPathEffect SkFlattenable SkRefCnt SkRefCntBase SkPath1DPathEffectImpl

Protected Member Functions

bool onFilterPath (SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *, const SkMatrix &) const override
 
virtual SkScalar begin (SkScalar contourLength) const =0
 
virtual SkScalar next (SkPath *dst, SkScalar dist, SkPathMeasure &) const =0
 

Private Member Functions

bool computeFastBounds (SkRect *) const override
 

Additional Inherited Members

- Public Types inherited from SkPathEffect
enum  DashType { kNone_DashType , kDash_DashType }
 
- Public Types inherited from SkFlattenable
enum  Type {
  kSkColorFilter_Type , kSkBlender_Type , kSkDrawable_Type , kSkDrawLooper_Type ,
  kSkImageFilter_Type , kSkMaskFilter_Type , kSkPathEffect_Type , kSkShader_Type
}
 
typedef sk_sp< SkFlattenable >(* Factory) (SkReadBuffer &)
 
- Public Member Functions inherited from SkPathEffectBase
 SkPathEffectBase ()
 
bool asPoints (PointData *results, const SkPath &src, const SkStrokeRec &, const SkMatrix &, const SkRect *cullR) const
 
SkFlattenable::Type getFlattenableType () const override
 
virtual bool onNeedsCTM () const
 
virtual bool onAsPoints (PointData *, const SkPath &, const SkStrokeRec &, const SkMatrix &, const SkRect *) const
 
virtual DashType onAsADash (DashInfo *) const
 
- Public Member Functions inherited from SkPathEffect
DashType asADash (DashInfo *info) const
 
bool filterPath (SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR) const
 
bool filterPath (SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR, const SkMatrix &ctm) const
 
bool needsCTM () const
 
- Public Member Functions inherited from SkFlattenable
 SkFlattenable ()
 
virtual Factory getFactory () const =0
 
virtual const char * getTypeName () const =0
 
virtual void flatten (SkWriteBuffer &) const
 
sk_sp< SkDataserialize (const SkSerialProcs *=nullptr) const
 
size_t serialize (void *memory, size_t memory_size, const SkSerialProcs *=nullptr) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Static Public Member Functions inherited from SkPathEffectBase
static sk_sp< SkPathEffectDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
static void RegisterFlattenables ()
 
- Static Public Member Functions inherited from SkPathEffect
static sk_sp< SkPathEffectMakeSum (sk_sp< SkPathEffect > first, sk_sp< SkPathEffect > second)
 
static sk_sp< SkPathEffectMakeCompose (sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)
 
static SkFlattenable::Type GetFlattenableType ()
 
static sk_sp< SkPathEffectDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
- Static Public Member Functions inherited from SkFlattenable
static Factory NameToFactory (const char name[])
 
static const char * FactoryToName (Factory)
 
static void Register (const char name[], Factory)
 
static sk_sp< SkFlattenableDeserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
 

Detailed Description

Definition at line 31 of file Sk1DPathEffect.cpp.

Member Function Documentation

◆ begin()

virtual SkScalar Sk1DPathEffect::begin ( SkScalar  contourLength) const
protectedpure virtual

Called at the start of each contour, returns the initial offset into that contour.

Implemented in SkPath1DPathEffectImpl.

◆ computeFastBounds()

bool Sk1DPathEffect::computeFastBounds ( SkRect ) const
inlineoverrideprivatevirtual

Implements SkPathEffectBase.

Definition at line 68 of file Sk1DPathEffect.cpp.

68{ return false; }

◆ next()

virtual SkScalar Sk1DPathEffect::next ( SkPath dst,
SkScalar  dist,
SkPathMeasure  
) const
protectedpure virtual

Called with the current distance along the path, with the current matrix for the point/tangent at the specified distance. Return the distance to travel for the next call. If return <= 0, then that contour is done.

Implemented in SkPath1DPathEffectImpl.

◆ onFilterPath()

bool Sk1DPathEffect::onFilterPath ( SkPath ,
const SkPath ,
SkStrokeRec ,
const SkRect ,
const SkMatrix  
) const
inlineoverrideprotectedvirtual

Filter the input path.

The CTM parameter is provided for path effects that can use the information. The output of path effects must always be in the original (input) coordinate system, regardless of whether the path effect uses the CTM or not.

Implements SkPathEffectBase.

Reimplemented in SkPath1DPathEffectImpl.

Definition at line 34 of file Sk1DPathEffect.cpp.

35 {
36 SkPathMeasure meas(src, false);
37 do {
38 int governor = MAX_REASONABLE_ITERATIONS;
39 SkScalar length = meas.getLength();
40 SkScalar distance = this->begin(length);
41 while (distance < length && --governor >= 0) {
42 SkScalar delta = this->next(dst, distance, meas);
43 if (delta <= 0) {
44 break;
45 }
46 distance += delta;
47 }
48 if (governor < 0) {
49 return false;
50 }
51 } while (meas.nextContour());
52 return true;
53 }
#define MAX_REASONABLE_ITERATIONS
virtual SkScalar next(SkPath *dst, SkScalar dist, SkPathMeasure &) const =0
virtual SkScalar begin(SkScalar contourLength) const =0
float SkScalar
Definition extension.cpp:12
size_t length

The documentation for this class was generated from the following file: