Replace deprecated methods from utilscocoa.mm (#1916)
This commit is contained in:
@@ -47,7 +47,7 @@ wxMacAutoreleasePool::~wxMacAutoreleasePool()
|
||||
CGContextRef wxOSXGetContextFromCurrentContext()
|
||||
{
|
||||
CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext]
|
||||
graphicsPort];
|
||||
CGContext];
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ CGImageRef WXDLLIMPEXP_CORE wxOSXGetCGImageFromImage( WXImage nsimage, CGRect* r
|
||||
#if wxOSX_USE_COCOA
|
||||
NSRect nsRect = NSRectFromCGRect(*r);
|
||||
return [nsimage CGImageForProposedRect:&nsRect
|
||||
context:[NSGraphicsContext graphicsContextWithGraphicsPort:cg flipped:YES]
|
||||
context:[NSGraphicsContext graphicsContextWithCGContext:cg flipped:YES]
|
||||
hints:nil];
|
||||
#else
|
||||
return [nsimage CGImage];
|
||||
@@ -264,7 +264,7 @@ CGContextRef WXDLLIMPEXP_CORE wxOSXCreateBitmapContextFromImage( WXImage nsimage
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
NSGraphicsContext *previousContext = [NSGraphicsContext currentContext];
|
||||
NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:hbitmap flipped:NO];
|
||||
NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext graphicsContextWithCGContext:hbitmap flipped:NO];
|
||||
[NSGraphicsContext setCurrentContext:nsGraphicsContext];
|
||||
[nsimage drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
|
||||
[NSGraphicsContext setCurrentContext:previousContext];
|
||||
@@ -294,7 +294,7 @@ void WXDLLIMPEXP_CORE wxOSXDrawNSImage(
|
||||
|
||||
#if wxOSX_USE_COCOA
|
||||
NSGraphicsContext *previousContext = [NSGraphicsContext currentContext];
|
||||
NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:inContext flipped:NO];
|
||||
NSGraphicsContext *nsGraphicsContext = [NSGraphicsContext graphicsContextWithCGContext:inContext flipped:NO];
|
||||
[NSGraphicsContext setCurrentContext:nsGraphicsContext];
|
||||
[inImage drawInRect:NSRectFromCGRect(r) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
|
||||
[NSGraphicsContext setCurrentContext:previousContext];
|
||||
@@ -653,4 +653,3 @@ wxOSXEffectiveAppearanceSetter::~wxOSXEffectiveAppearanceSetter()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user