the provided table's are optional in the TableColorFilter
@@ -12,9 +12,13 @@ impl TableColorFilter {
}).unwrap()
}
- pub fn from_argb(table_a: &[u8; 256], table_r: &[u8; 256], table_g: &[u8; 256], table_b: &[u8; 256] ) -> ColorFilter {
+ pub fn from_argb(table_a: Option<&[u8; 256]>, table_r: Option<&[u8; 256]>, table_g: Option<&[u8; 256]>, table_b: Option<&[u8; 256]> ) -> ColorFilter {
ColorFilter::from_ptr(unsafe {
- C_SkTableColorFilter_MakeARGB(table_a.as_ptr(), table_r.as_ptr(), table_g.as_ptr(), table_b.as_ptr())
+ C_SkTableColorFilter_MakeARGB(
+ table_a.as_ptr_or_null() as _,
+ table_r.as_ptr_or_null() as _,
+ table_g.as_ptr_or_null() as _,
+ table_b.as_ptr_or_null() as _)
}).unwrap()
}
}
\ No newline at end of file
