Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Friends | List of all members
SkComposePathEffect Class Reference
Inheritance diagram for SkComposePathEffect:
SkPairPathEffect SkPathEffectBase SkPathEffect SkFlattenable SkRefCnt SkRefCntBase

Public Member Functions

 SkComposePathEffect (sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)
 
bool onFilterPath (SkPath *dst, const SkPath &src, SkStrokeRec *rec, const SkRect *cullRect, const SkMatrix &ctm) const override
 
bool computeFastBounds (SkRect *bounds) const override
 
- 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 onFilterPath (SkPath *, const SkPath &, SkStrokeRec *, const SkRect *, const SkMatrix &) const =0
 
virtual bool onNeedsCTM () const
 
virtual bool onAsPoints (PointData *, const SkPath &, const SkStrokeRec &, const SkMatrix &, const SkRect *) const
 
virtual DashType onAsADash (DashInfo *) const
 
virtual bool computeFastBounds (SkRect *bounds) const =0
 
- 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
 
virtual Type getFlattenableType () const =0
 
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

static sk_sp< SkPathEffectMake (sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)
 
- 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)
 

Friends

class SkPathEffect
 

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 &)
 
- Protected Member Functions inherited from SkPairPathEffect
 SkPairPathEffect (sk_sp< SkPathEffect > pe0, sk_sp< SkPathEffect > pe1)
 
void flatten (SkWriteBuffer &buffer) const override
 
- Protected Attributes inherited from SkPairPathEffect
sk_sp< SkPathEffectfPE0
 
sk_sp< SkPathEffectfPE1
 

Detailed Description

Definition at line 92 of file SkPathEffect.cpp.

Constructor & Destructor Documentation

◆ SkComposePathEffect()

SkComposePathEffect::SkComposePathEffect ( sk_sp< SkPathEffect outer,
sk_sp< SkPathEffect inner 
)
inline

Definition at line 109 of file SkPathEffect.cpp.

110 : INHERITED(std::move(outer), std::move(inner)) {}

Member Function Documentation

◆ computeFastBounds()

bool SkComposePathEffect::computeFastBounds ( SkRect bounds) const
inlineoverridevirtual

Implements SkPathEffectBase.

Definition at line 125 of file SkPathEffect.cpp.

125 {
126 // inner (fPE1) is computed first, automatically updating bounds before computing outer.
129 }
static SkPathEffectBase * as_PEB(SkPathEffect *effect)
sk_sp< SkPathEffect > fPE0
sk_sp< SkPathEffect > fPE1
virtual bool computeFastBounds(SkRect *bounds) const =0
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ Make()

static sk_sp< SkPathEffect > SkComposePathEffect::Make ( sk_sp< SkPathEffect outer,
sk_sp< SkPathEffect inner 
)
inlinestatic

Construct a pathEffect whose effect is to apply first the inner pathEffect and the the outer pathEffect (e.g. outer(inner(path))) The reference counts for outer and inner are both incremented in the constructor, and decremented in the destructor.

Definition at line 99 of file SkPathEffect.cpp.

99 {
100 if (!outer) {
101 return inner;
102 }
103 if (!inner) {
104 return outer;
105 }
106 return sk_sp<SkPathEffect>(new SkComposePathEffect(outer, inner));
107 }
SkComposePathEffect(sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)

◆ onFilterPath()

bool SkComposePathEffect::onFilterPath ( SkPath ,
const SkPath ,
SkStrokeRec ,
const SkRect ,
const SkMatrix  
) const
inlineoverridevirtual

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.

Definition at line 112 of file SkPathEffect.cpp.

113 {
114 SkPath tmp;
115 const SkPath* ptr = &src;
116
117 if (fPE1->filterPath(&tmp, src, rec, cullRect, ctm)) {
118 ptr = &tmp;
119 }
120 return fPE0->filterPath(dst, *ptr, rec, cullRect, ctm);
121 }
bool filterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR) const
Definition: SkPath.h:59
dst
Definition: cp.py:12

Friends And Related Function Documentation

◆ SkPathEffect

friend class SkPathEffect
friend

Definition at line 135 of file SkPathEffect.cpp.


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