support ColorSpace to be optionan in Image::new_texture_image
@@ -406,18 +406,18 @@ impl RCHandle<SkImage> {
})
}
- pub fn new_texture_image(
+ pub fn new_texture_image<'a, ICS: Into<Option<&'a ColorSpace>>>(
&self,
context: &mut gpu::Context,
- dst_color_space: &ColorSpace,
+ dst_color_space: ICS,
mip_mapped: gpu::MipMapped) -> Option<Image> {
Image::from_ptr(unsafe {
C_SkImage_makeTextureImage(
self.native(),
context.native_mut(),
- dst_color_space.native_mut_force(),
- mip_mapped.native().to_owned())
+ dst_color_space.into().native_ptr_or_null(),
+ mip_mapped.into_native())
})
}
