macOS Tahoe: NSView -cacheDisplayInRect:toBitmapImageRep: Doesn't Work on NSButton that uses NSBezelStyleGlass

If I try making a bitmap of a NSButton using the following code:

 NSBitmapImageRep *rep = [button bitmapImageRepForCachingDisplayInRect:button.bounds];
  [button cacheDisplayInRect:button.bounds toBitmapImageRep:rep];
NSData *tiffData = rep.TIFFRepresentation;

I get a blank image if the NSButton has its bezelStyle set to NSBezelStyleGlass.

If I change the bezel style to something else like NSBezelStyleFlexiblePush I do get an image

FB20272917

macOS Tahoe: NSView -cacheDisplayInRect:toBitmapImageRep: Doesn't Work on NSButton that uses NSBezelStyleGlass
 
 
Q