Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SkDiscretePathEffect Class Reference

#include <SkDiscretePathEffect.h>

Static Public Member Functions

static sk_sp< SkPathEffectMake (SkScalar segLength, SkScalar dev, uint32_t seedAssist=0)
 
static void RegisterFlattenables ()
 

Detailed Description

This path effect chops a path into discrete segments, and randomly displaces them.

Definition at line 17 of file SkDiscretePathEffect.h.

Member Function Documentation

◆ Make()

sk_sp< SkPathEffect > SkDiscretePathEffect::Make ( SkScalar  segLength,
SkScalar  dev,
uint32_t  seedAssist = 0 
)
static

Break the path into segments of segLength length, and randomly move the endpoints away from the original path by a maximum of deviation. Note: works on filled or framed paths

Parameters
seedAssistThis is a caller-supplied seedAssist that modifies the seed value that is used to randomize the path segments' endpoints. If not supplied it defaults to 0, in which case filtering a path multiple times will result in the same set of segments (this is useful for testing). If a caller does not want this behaviour they can pass in a different seedAssist to get a different set of path segments.

Definition at line 179 of file SkDiscretePathEffect.cpp.

180 {
181 if (!SkIsFinite(segLength, deviation)) {
182 return nullptr;
183 }
184 if (segLength <= SK_ScalarNearlyZero) {
185 return nullptr;
186 }
187 return sk_sp<SkPathEffect>(new SkDiscretePathEffectImpl(segLength, deviation, seedAssist));
188}
static bool SkIsFinite(T x, Pack... values)
#define SK_ScalarNearlyZero
Definition SkScalar.h:99

◆ RegisterFlattenables()

void SkDiscretePathEffect::RegisterFlattenables ( )
static

Definition at line 190 of file SkDiscretePathEffect.cpp.

190 {
192}
static sk_sp< SkFlattenable > CreateProc(SkReadBuffer &buffer)
static void Register(const char name[], Factory)

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