A general clean-up of the CoreGraphics implementation, instead of creating a new NSView and rendering into the layer there, we create a sublayer. See the code comments, and also https://github.com/gfx-rs/wgpu/pull/6107 for some of the design decisions around this.
This is also a step forwards for making softbuffer usable from a separate thread on Apple platforms, as CALayer is fully thread safe (whereas NSView/UIView aren't).
A general clean-up of the CoreGraphics implementation, instead of creating a new
NSView
and rendering into the layer there, we create a sublayer. See the code comments, and also https://github.com/gfx-rs/wgpu/pull/6107 for some of the design decisions around this.This is also a step forwards for making
softbuffer
usable from a separate thread on Apple platforms, asCALayer
is fully thread safe (whereasNSView
/UIView
aren't).Finally, it removes our dependence on having access to
NSView
, paving the way for a future whereraw-window-handle
may only provideCALayer
.Fixes https://github.com/rust-windowing/softbuffer/issues/43.