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

Public Member Functions

 SkSumPathEffect (sk_sp< SkPathEffect > first, sk_sp< SkPathEffect > second)
 
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 > first, sk_sp< SkPathEffect > second)
 
- 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

This subclass of SkPathEffect applies two pathEffects, one after the other. Its filterPath() returns true if either of the effects succeeded.

Definition at line 153 of file SkPathEffect.cpp.

Constructor & Destructor Documentation

◆ SkSumPathEffect()

SkSumPathEffect::SkSumPathEffect ( sk_sp< SkPathEffect first,
sk_sp< SkPathEffect second 
)
inline

Definition at line 170 of file SkPathEffect.cpp.

171 : INHERITED(std::move(first), std::move(second)) {}

Member Function Documentation

◆ computeFastBounds()

bool SkSumPathEffect::computeFastBounds ( SkRect bounds) const
inlineoverridevirtual

Implements SkPathEffectBase.

Definition at line 183 of file SkPathEffect.cpp.

183 {
184 // Unlike Compose(), PE0 modifies the path first for Sum
187 }
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 > SkSumPathEffect::Make ( sk_sp< SkPathEffect first,
sk_sp< SkPathEffect second 
)
inlinestatic

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

Definition at line 160 of file SkPathEffect.cpp.

160 {
161 if (!first) {
162 return second;
163 }
164 if (!second) {
165 return first;
166 }
167 return sk_sp<SkPathEffect>(new SkSumPathEffect(first, second));
168 }
SkSumPathEffect(sk_sp< SkPathEffect > first, sk_sp< SkPathEffect > second)

◆ onFilterPath()

bool SkSumPathEffect::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 173 of file SkPathEffect.cpp.

174 {
175 // always call both, even if the first one succeeds
176 bool filteredFirst = fPE0->filterPath(dst, src, rec, cullRect, ctm);
177 bool filteredSecond = fPE1->filterPath(dst, src, rec, cullRect, ctm);
178 return filteredFirst || filteredSecond;
179 }
bool filterPath(SkPath *dst, const SkPath &src, SkStrokeRec *, const SkRect *cullR) const
dst
Definition: cp.py:12

Friends And Related Function Documentation

◆ SkPathEffect

friend class SkPathEffect
friend

Definition at line 193 of file SkPathEffect.cpp.


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