Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
SkDashPathEffect Class Reference

#include <SkDashPathEffect.h>

Static Public Member Functions

static sk_sp< SkPathEffectMake (const SkScalar intervals[], int count, SkScalar phase)
 

Detailed Description

Definition at line 17 of file SkDashPathEffect.h.

Member Function Documentation

◆ Make()

sk_sp< SkPathEffect > SkDashPathEffect::Make ( const SkScalar  intervals[],
int  count,
SkScalar  phase 
)
static

intervals: array containing an even number of entries (>=2), with the even indices specifying the length of "on" intervals, and the odd indices specifying the length of "off" intervals. This array will be copied in Make, and can be disposed of freely after. count: number of elements in the intervals array phase: offset into the intervals array (mod the sum of all of the intervals).

For example: if intervals[] = {10, 20}, count = 2, and phase = 25, this will set up a dashed path like so: 5 pixels off 10 pixels on 20 pixels off 10 pixels on 20 pixels off ... A phase of -5, 25, 55, 85, etc. would all result in the same path, because the sum of all the intervals is 30.

Note: only affects stroked paths.

Definition at line 409 of file SkDashPathEffect.cpp.

409 {
410 if (!SkDashPath::ValidDashPath(phase, intervals, count)) {
411 return nullptr;
412 }
413 return sk_sp<SkPathEffect>(new SkDashImpl(intervals, count, phase));
414}
int count
Definition: FontMgrTest.cpp:50
bool ValidDashPath(SkScalar phase, const SkScalar intervals[], int32_t count)
Definition: SkDashPath.cpp:476

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