From 6312a8e9382105196fdf1edddfc68a678acd673e Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 28 Dec 2020 10:40:50 +0000 Subject: Change pixel format * src/nsterm.m ([EmacsSurface getContext]): Use BGRA for the IOSurface and specify the CGContext explicitly for compatibility with a wider range of Macs. --- src/nsterm.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 63f48cd242b..b5eb3ac03ba 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -9597,7 +9597,7 @@ not_in_argv (NSString *arg) (id)kIOSurfaceHeight:[NSNumber numberWithInt:size.height], (id)kIOSurfaceBytesPerRow:[NSNumber numberWithInt:bytesPerRow], (id)kIOSurfaceBytesPerElement:[NSNumber numberWithInt:4], - (id)kIOSurfacePixelFormat:[NSNumber numberWithUnsignedInt:'RGBA']}); + (id)kIOSurfacePixelFormat:[NSNumber numberWithUnsignedInt:'BGRA']}); } IOReturn lockStatus = IOSurfaceLock (surface, 0, nil); @@ -9614,7 +9614,8 @@ not_in_argv (NSString *arg) 8, IOSurfaceGetBytesPerRow (currentSurface), colorSpace, - IOSurfaceGetPixelFormat (currentSurface)); + (kCGImageAlphaPremultipliedFirst + | kCGBitmapByteOrder32Host)); return context; } -- cgit v1.2.1