1 | use crate::{prelude::*, scalar, PathEffect}; |
---|---|
2 | use skia_bindings as sb; |
3 | |
4 | impl PathEffect { |
5 | pub fn dash(intervals: &[scalar], phase: scalar) -> Option<Self> { |
6 | new(intervals, phase) |
7 | } |
8 | } |
9 | |
10 | pub fn new(intervals: &[scalar], phase: scalar) -> Option<PathEffect> { |
11 | PathEffect::from_ptr(unsafe { |
12 | sb::C_SkDashPathEffect_Make( |
13 | intervals:intervals.as_ptr(), |
14 | count:intervals.len().try_into().unwrap(), |
15 | phase, |
16 | ) |
17 | }) |
18 | } |
19 |