Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | Private Member Functions | List of all members
sksg::DashEffect Class Referencefinal

#include <SkSGGeometryEffect.h>

Inheritance diagram for sksg::DashEffect:
sksg::GeometryEffect sksg::GeometryNode sksg::Node SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< DashEffectMake (sk_sp< GeometryNode > child)
 

Private Member Functions

SkPath onRevalidateEffect (const sk_sp< GeometryNode > &) override
 

Additional Inherited Members

- Public Member Functions inherited from sksg::GeometryNode
void clip (SkCanvas *, bool antiAlias) const
 
void draw (SkCanvas *, const SkPaint &) const
 
bool contains (const SkPoint &) const
 
SkPath asPath () const
 
- Public Member Functions inherited from sksg::Node
const SkRectrevalidate (InvalidationController *, const SkMatrix &)
 
void invalidate (bool damage=true)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Protected Types inherited from sksg::Node
enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 
- Protected Member Functions inherited from sksg::GeometryEffect
 GeometryEffect (sk_sp< GeometryNode >)
 
 ~GeometryEffect () override
 
void onClip (SkCanvas *, bool antiAlias) const final
 
void onDraw (SkCanvas *, const SkPaint &) const final
 
bool onContains (const SkPoint &) const final
 
SkRect onRevalidate (InvalidationController *, const SkMatrix &) final
 
SkPath onAsPath () const final
 
- Protected Member Functions inherited from sksg::GeometryNode
 GeometryNode ()
 
- Protected Member Functions inherited from sksg::Node
 Node (uint32_t invalTraits)
 
 ~Node () override
 
const SkRectbounds () const
 
bool hasInval () const
 
void observeInval (const sk_sp< Node > &)
 
void unobserveInval (const sk_sp< Node > &)
 

Detailed Description

Apply a dash effect to the child geometry.

Follows the same semantics as SkDashPathEffect, with one minor tweak: when the number of intervals is odd, they are repeated once more to attain an even sequence (same as SVG stroke-dasharray: https://www.w3.org/TR/SVG11/painting.html#StrokeDasharrayProperty).

Definition at line 113 of file SkSGGeometryEffect.h.

Member Function Documentation

◆ Make()

static sk_sp< DashEffect > sksg::DashEffect::Make ( sk_sp< GeometryNode child)
inlinestatic

Definition at line 115 of file SkSGGeometryEffect.h.

115 {
116 return child ? sk_sp<DashEffect>(new DashEffect(std::move(child))) : nullptr;
117 }

◆ onRevalidateEffect()

SkPath sksg::DashEffect::onRevalidateEffect ( const sk_sp< GeometryNode > &  child)
overrideprivatevirtual

Implements sksg::GeometryEffect.

Definition at line 131 of file SkSGGeometryEffect.cpp.

131 {
132 SkPath path = child->asPath();
133
134 if (const auto dash_patheffect = make_dash(fIntervals, fPhase)) {
136 SkASSERT(!dash_patheffect->needsCTM());
137 dash_patheffect->filterPath(&path, path, &rec, nullptr);
138 }
139
140 return path;
141}
static sk_sp< SkPathEffect > make_dash()
#define SkASSERT(cond)
Definition SkAssert.h:116
@ kHairline_InitStyle
Definition SkStrokeRec.h:25
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

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