After investigation, the -[NSView makeBackingLayer] method (of a layer host view) on macOS Sonoma, creates a layer of type NSViewBackingLayer, compared to the layer of type _ NSViewBackingLayer, created on macOS Ventura and earlier. Similarly, the -[NSClipView makeBackingLayer] method on macOS Sonoma creates a layer of type NSViewBackingLayer (like NSView), compared to the layer of type _NSClipViewBackingLayer, created on macOS Ventura and earlier. I think all the problems with invalidating and updating a view's rectangle arise from these changes. Last but not least, these changes interfere, inevitably and very negatively, with the responsive scrolling of the view itself.
Apparently NSViewBackingLayer seems to work in a much less sophisticated way than _ NSViewBackingLayer. With macOS Ventura and earlier, tiling, clipping, responsive scrolling even with very large views at high magnification and prefetching of view content outside of its immediate visibleRect, were perfect. With macOS Sonoma, everything has gotten significantly worse.
This is a serious bug. I just hope Apple fixes this immediately.
ref. https://devstreaming-cdn.apple.com/videos/wwdc/2013/215xax3xz5pbbxeaxxe7z1mk3q/215/215-HD.mov
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: