summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2020-12-28 10:40:50 +0000
committerAlan Third <alan@idiocy.org>2020-12-31 15:38:08 +0000
commit6312a8e9382105196fdf1edddfc68a678acd673e (patch)
tree7731f71da3f389a1ca274db64f1d54d0a9990bbe
parentaeb2475816bfdf7e52284fedf693d3f36940652a (diff)
downloademacs-scratch/ns/performance.tar.gz
Change pixel formatscratch/ns/performance
* src/nsterm.m ([EmacsSurface getContext]): Use BGRA for the IOSurface and specify the CGContext explicitly for compatibility with a wider range of Macs.
-rw-r--r--src/nsterm.m5
1 files 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;
}