Redo layer creation to create a sub layer if needed #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Redo layer creation to match what's outlined in gfx-rs/wgpu#6107.
A deviation from that PR is that we track the bounds and scale factor from the super layer using observers. This fixes the issue in gfx-rs/wgpu#6107 (comment), and is also what I intend to do in Wgpu, but it's just a huge hazzle to do correctly without
objc2
, which Wgpu doesn't yet use.The new API is:
Layer::from_layer
Layer::from_ns_view
(replacesappkit::metal_layer_from_ns_view
andappkit::metal_layer_from_handle
)Layer::from_ui_view
(replacesuikit::metal_layer_from_ui_view
anduikit::metal_layer_from_handle
)Fixes #11 by removing dependency on
raw-window-handle
(since it's one line for the user to get a layer from the handle).I have tested this with a fork of
ash
, ofvulkano
and ofwgpu
, seems to work fine there.