fix pointer generation for the table color filter
@@ -15,10 +15,10 @@ impl TableColorFilter {
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_or_null() as _,
- table_r.as_ptr_or_null() as _,
- table_g.as_ptr_or_null() as _,
- table_b.as_ptr_or_null() as _)
+ table_a.map(|t| t.as_ref()).as_ptr_or_null() as _,
+ table_r.map(|t| t.as_ref()).as_ptr_or_null() as _,
+ table_g.map(|t| t.as_ref()).as_ptr_or_null() as _,
+ table_b.map(|t| t.as_ref()).as_ptr_or_null() as _)
}).unwrap()
}
}
\ No newline at end of file
