emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/ns/performance 6312a8e 6/6: Change pixel format


From: Alan Third
Subject: scratch/ns/performance 6312a8e 6/6: Change pixel format
Date: Thu, 31 Dec 2020 10:45:20 -0500 (EST)

branch: scratch/ns/performance
commit 6312a8e9382105196fdf1edddfc68a678acd673e
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    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 63f48cd..b5eb3ac 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;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]