Commit 5675553
feat(cg): use IOSurface with single-buffering
Back the CoreGraphics buffer with an IOSurface instead of CGDataProvider.
IOSurface is shared zero-copy with the compositor, avoiding the internal
copy QuartzCore did on present.
- keep single-buffer model; block on `is_in_use` in next_buffer before
writing, since the compositor reads the surface directly (no internal
copy to rely on)
- stride uses surface.bytes_per_row (may be padded for alignment)
- present sets CALayer.contents to the IOSurface, disabling actions to
avoid the contents fade
- scale content to fill via kCAGravityResize + nearest-neighbour filters
- IOSurface supports Opaque|Premultiplied only; update supports_alpha_mode
and AlphaMode platform docs accordingly
- swap deps: drop CGDataProvider/CGImage, add objc2-io-surface + CF
Number/String/Dictionary features
Replaces the branch's earlier triple/unbounded-buffer commits; upstream
moved to single-buffering (rust-windowing#343) while rust-windowing#329 kept multi-buffering.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 840683c commit 5675553
3 files changed
Lines changed: 245 additions & 250 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | | - | |
102 | | - | |
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
106 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
125 | 132 | | |
126 | 133 | | |
127 | 134 | | |
| |||
0 commit comments