What is the best way to make NSView drawRect: render content that is drawn and updated by a background thread continuously?
- Background thread updates backing store & flags view for update
- macOS calls drawRect: to render backing store to screen
The background thread is running permanently.
Up until SDK 10.13 it was possible to have the background thread lockFocus / unlockFocus on NSView, which very efficiently populated the view's backing store. Rendering that backing store to screen in drawRect: was a snap.
With SDK 10.14 this no longer works (view remains black).
While it's possible to use a bitmap as a backing store, I'd prefer to avoid dealing with screen resolution and other specifics. I hope there's a more transparent and lean way (layers?)