@@ -6,8 +6,7 @@ use objc2::runtime::{AnyObject, Bool};
66use objc2:: { define_class, msg_send, AllocAnyThread , DefinedClass , MainThreadMarker , Message } ;
77use objc2_core_foundation:: { CFRetained , CGPoint } ;
88use objc2_core_graphics:: {
9- CGBitmapInfo , CGColorRenderingIntent , CGColorSpace , CGColorSpaceCreateDeviceRGB ,
10- CGDataProviderCreateWithData , CGImageAlphaInfo , CGImageCreate ,
9+ CGBitmapInfo , CGColorRenderingIntent , CGColorSpace , CGDataProvider , CGImage , CGImageAlphaInfo ,
1110} ;
1211use objc2_foundation:: {
1312 ns_string, NSDictionary , NSKeyValueChangeKey , NSKeyValueChangeNewKey ,
@@ -229,7 +228,7 @@ impl<D: HasDisplayHandle, W: HasWindowHandle> SurfaceInterface<D, W> for CGImpl<
229228 layer. setContentsGravity ( unsafe { kCAGravityTopLeft } ) ;
230229
231230 // Initialize color space here, to reduce work later on.
232- let color_space = unsafe { CGColorSpaceCreateDeviceRGB ( ) } . unwrap ( ) ;
231+ let color_space = unsafe { CGColorSpace :: new_device_rgb ( ) } . unwrap ( ) ;
233232
234233 // Grab initial width and height from the layer (whose properties have just been initialized
235234 // by the observer using `NSKeyValueObservingOptionInitial`).
@@ -310,12 +309,12 @@ impl<D: HasDisplayHandle, W: HasWindowHandle> BufferInterface for BufferImpl<'_,
310309 // SAFETY: The data pointer and length are valid.
311310 // The info pointer can safely be NULL, we don't use it in the `release` callback.
312311 unsafe {
313- CGDataProviderCreateWithData ( ptr:: null_mut ( ) , data_ptr, len, Some ( release) ) . unwrap ( )
312+ CGDataProvider :: with_data ( ptr:: null_mut ( ) , data_ptr, len, Some ( release) ) . unwrap ( )
314313 }
315314 } ;
316315
317316 let image = unsafe {
318- CGImageCreate (
317+ CGImage :: new (
319318 self . imp . width ,
320319 self . imp . height ,
321320 8 ,
0 commit comments