| 1 | use crate::{scalar, Matrix, Path, PathEffect}; |
| 2 | |
| 3 | impl PathEffect { |
| 4 | pub fn line_2d(width: scalar, matrix: &Matrix) -> Option<PathEffect> { |
| 5 | line_2d_path_effect::new(width, matrix) |
| 6 | } |
| 7 | |
| 8 | pub fn path_2d(matrix: &Matrix, path: &Path) -> PathEffect { |
| 9 | path_2d_path_effect::new(matrix, path) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | pub mod line_2d_path_effect { |
| 14 | use crate::{prelude::*, scalar, Matrix, PathEffect}; |
| 15 | use skia_bindings as sb; |
| 16 | |
| 17 | pub fn new(width: scalar, matrix: &Matrix) -> Option<PathEffect> { |
| 18 | PathEffect::from_ptr(unsafe { sb::C_SkLine2DPathEffect_Make(width, matrix.native()) }) |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | pub mod path_2d_path_effect { |
| 23 | use crate::{prelude::*, Matrix, Path, PathEffect}; |
| 24 | use skia_bindings as sb; |
| 25 | |
| 26 | pub fn new(matrix: &Matrix, path: &Path) -> PathEffect { |
| 27 | PathEffectOption>::from_ptr(unsafe { |
| 28 | sb::C_SkPath2DPathEffect_Make(matrix.native(), path.native()) |
| 29 | }) |
| 30 | .unwrap() |
| 31 | } |
| 32 | } |
| 33 | |