emacs-devel
[Top][All Lists]
Advanced

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

Re: macOS graphics performance


From: Alan Third
Subject: Re: macOS graphics performance
Date: Sun, 27 Dec 2020 23:26:29 +0000

On Mon, Dec 28, 2020 at 12:33:07AM +0200, Andrii Kolomoiets wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > I would appreciate it if people running various versions of macOS give
> > it a go. It should only improve things for people running macOS 10.14
> > and above, but I'd still appreciate knowing whether it breaks anything
> > on older macOS versions.
> 
> The Emacs frame is totally "empty" for me.  No text is drawn.

Thanks for testing! I think this is probably down to the pixel format,
which I don't even begin to understand the logic behind.

Can you please try again with this patch:

modified   src/nsterm.m
@@ -9596,7 +9596,7 @@ - (CGContextRef) getContext
             (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);
@@ -9613,7 +9613,8 @@ - (CGContextRef) getContext
                                    8,
                                    IOSurfaceGetBytesPerRow (currentSurface),
                                    colorSpace,
-                                   IOSurfaceGetPixelFormat (currentSurface));
+                                   (kCGImageAlphaPremultipliedFirst
+                                    | kCGBitmapByteOrder32Host));
   return context;
 }

-- 
Alan Third



reply via email to

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