Commit graph

58 commits

Author SHA1 Message Date
dependabot[bot]
979812f4bc
build(deps): update redox_syscall requirement from 0.3 to 0.4
Updates the requirements on redox_syscall to permit the latest version.

---
updated-dependencies:
- dependency-name: redox_syscall
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-14 18:07:18 -07:00
Ian Douglas Scott
36618b63eb
Merge pull request #149 from rust-windowing/update-wayland
wayland: Update to wayland-client 0.31
2023-09-09 16:42:57 -07:00
Ian Douglas Scott
e145d47cf8 v0.3.1
Softbuffer is broken on recent builds of Redox without the fix here, so
it's helpful to have a new release that fixes it. We seem to have
accumulated a few non-breaking fixes, so it seems like a good enough
time to do a release anyway.

Disabling `fetch` on Windows could be considered breaking, but it
doesn't change the API, was broken anyway, and is likely unused. So I
don't think that's an issue.
2023-09-09 16:30:55 -07:00
Ian Douglas Scott
a9d7e159e0 wayland: Update to wayland-client 0.31
Updates `rust-version` from 1.64 to 1.65.
2023-09-07 19:12:01 -07:00
Mads Marquart
bac64da8b8 Update macOS dependencies 2023-08-29 08:57:45 +02:00
Mads Marquart
c5401a3ec2
Merge pull request #128 from rust-windowing/dependabot/cargo/cocoa-0.25.0
Update cocoa requirement from 0.24.0 to 0.25.0
2023-08-29 08:51:42 +02:00
John Nunley
ac0b7f5e14
feat: Add a DRM/KMS backend
This adds a DRM/KMS based backend to the system, as per #42. This system finds a CRTC and a connector, then uses that to create a frame buffer and a DUMB buffer that it can render to.

There's much more to do, and is left as an exercise for anyone with a significant DRM-based use case to pick up and fix.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-12 13:39:13 -07:00
John Nunley
abb7a4e9ac
version: Use fastrand v2.0.0 2023-07-03 07:59:34 -07:00
dependabot[bot]
4a1e18daf9
m: Update memmap2 requirement from 0.6.1 to 0.7.1
Updates the requirements on [memmap2](https://github.com/RazrFalcon/memmap2-rs) to permit the latest version.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.6.1...v0.7.1)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-02 15:19:49 -07:00
John Nunley
3404953bdb
m: Use tiny-xlib instead of x11-dl
My new tiny-xlib crate takes up a fraction of the space that the x11-dl crate uses, supports
feature-based static linking and involves less of Xlib's ridiculous surface.
2023-07-02 15:08:01 -07:00
dependabot[bot]
b5c14abf75
Update cocoa requirement from 0.24.0 to 0.25.0
Updates the requirements on [cocoa](https://github.com/servo/core-foundation-rs) to permit the latest version.
- [Commits](https://github.com/servo/core-foundation-rs/commits)

---
updated-dependencies:
- dependency-name: cocoa
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 05:09:01 +00:00
dAxpeDDa
6c78268502 Implement OffscreenCanvas support 2023-06-05 01:39:28 +02:00
John Nunley
68ec5a52d3
v0.3.0
* On MacOS, the contents scale is updated when set_buffer() is called, to adapt when the window is on a new screen (#68).
* **Breaking:** Split the `GraphicsContext` type into `Context` and `Surface` (#64).
* On Web, cache the document in the `Context` type (#66).
* **Breaking:** Introduce a new "owned buffer" for no-copy presentation (#65).
* Enable support for multi-threaded WASM (#77).
* Fix buffer resizing on X11 (#69).
* Add a set of functions for handling buffer damage (#99).
* Add a `fetch()` function for getting the window contents (#104).
* Bump MSRV to 1.64 (#81).
2023-06-04 16:10:35 -07:00
John Nunley
7b089d46b2
Remove the thiserror dependency (#116) 2023-06-03 07:08:35 -07:00
John Nunley
44248477be
feat: Add a function for retrieving the window contents
This function is useful for testing the window contents in certain cases. In addition,
this means that we can now have reliable tests for softbuffer's actual functionality.

Signed-off-by: John Nunley <jtnunley01@gmail.com>
Co-authored-by: dAxpeDDa <daxpedda@gmail.com>
2023-06-01 20:09:30 -07:00
dAxpeDDa
eb227f10f0 Bump x11rb to v0.12 2023-05-27 17:10:18 +02:00
dependabot[bot]
4268c732a6
Update memmap2 requirement from 0.5.8 to 0.6.1 (#108) 2023-05-15 06:48:56 -07:00
daxpedda
fcda747ddf
Add from_canvas() to Surface for Wasm (#76)
Co-authored-by: Toniman575 <toniman575@gmail.com>
2023-05-08 15:43:34 +02:00
John Nunley
885c76bf02
m: Don't use the borrowing trick under X11 (#86) 2023-04-07 11:54:50 -07:00
John Nunley
379910cb8e
Merge pull request #77 from daxpedda/wasm-atomics
Fix multi-threaded Wasm
2023-04-06 10:40:23 -07:00
Ian Douglas Scott
7a687105e3 Update windows-sys and image 2023-04-06 08:37:57 -07:00
dAxpeDDa
c0af587718
Fix multi-threaded Wasm 2023-04-06 17:35:14 +02:00
Ian Douglas Scott
a09e4cf679
Owned pixel buffer for no-copy presentation
This is based on the API that will be used for no-copy presentation. But
wraps it in `set_buffer`.

This also fixes the Wayland buffer code to set `self.width` and
`self.height` on resize, and set the length of the shared memory file
when the buffer is created.

Co-authored-by: jtnunley <jtnunley01@gmail.com>
2023-04-06 10:30:59 +03:00
John Nunley
77f9f68f45
Bump MSRV to 1.64 (#81)
raw-window-handle bumped MSRV, so should we
2023-03-17 19:56:10 -07:00
Ian Douglas Scott
3b9976685c Add run-wasm workspace member, as used in winit
This makes it easy to run examples with the web backend, in the same way
that winit examples are run.
2023-02-23 08:49:36 -08:00
Ian Douglas Scott
dce6cbc111 Update windows-sys dependency, and winit dev dependency
Using the latest `winit` version in examples fixes resizing behavior on
Wayland, so the workaround for that in the `winit` example is also
removed here.
2023-02-20 10:22:34 -08:00
Jeremy Soller
02da341d51
0.2.0 2023-01-06 09:07:11 -07:00
John Nunley
a6042f664d
x11: Implement image transfer using the MIT-SHM extension (#46)
* Implement shared memory transfer for X11

* Change to x11rb

* Fix leak + review from psychon

* Add waits to prevent illegal writes to SHM

* @ids1024 code review
2023-01-05 19:27:54 -08:00
John Nunley
0f1effe958
chore: Alphabetize dependencies (#58) 2023-01-05 22:37:30 +00:00
Ian Douglas Scott
a90c7bca04 Use cfg_aliases crate to make Wayland/X #[cfg(..)] less redundant 2023-01-03 12:45:18 -08:00
Ian Douglas Scott
4f6542ceaa Add support and CI tests for BSDs
This adds a fallback using `shm_open`/`shm_unlink` for platforms where
`memfd_create` doesn't exist. This seems to be how this is normally
handled, though it's a bit ugly.

This also builds the wayland/x11 code for NetBSD/OpenBSD/DragonFlyBSD.

Add CI builds for FreeBSD and NetBSD. We would need some kind of
virtualisation though to actually run tests on such targets.

I've tested the `shm_open` logic on Linux, but haven't run it on any
BSDs.
2023-01-03 12:45:15 -08:00
Ian Douglas Scott
0109b1538a Specify rust-version in Cargo.toml 2022-12-27 12:20:07 -08:00
Ian Douglas Scott
ca3988a2f7 Use stable 0.30 release of wayland-client 2022-12-27 12:18:14 -08:00
John Nunley
3eeafad834
x11: Add XCB support to the X11 backend (#52) 2022-12-27 09:14:54 -08:00
David Johnson
ddb1b9bfeb Updated Cargo.toml to reflect swbuf+softbuffer merge 2022-12-22 18:39:56 -06:00
Ian Douglas Scott
f193f10ec0 Add wayland-dlopen feature, like winit 2022-12-21 19:45:27 -07:00
Ian Douglas Scott
c73bd4b836 Add feature flags for x11 and wayland
Winit has features for these, so it makes sense to offer the same.
2022-12-21 16:20:15 -08:00
jtnunley
85b4f189bd Port to win32 2022-12-20 09:11:45 -07:00
Ian Douglas Scott
33fe3ae3c7
Enable Wayland and x11 code on FreeBSD 2022-12-20 07:11:10 -07:00
Ian Douglas Scott
3dc11f75c1
Improvements to wayland backend
- Use wayland-client `0.30.0-beta.14`
- Use `memfd` instead of temporary file
- Make sure buffer and buffer pool objects are destroyed
2022-12-20 07:11:10 -07:00
Jeremy Soller
7351d68814
Add Redox/Orbital support 2022-12-20 07:11:09 -07:00
Jeremy Soller
939bcc44d8
Fork to swbuf 2022-12-20 07:07:57 -07:00
David Johnson
d30d3255c2 Updated winit to 0.27.2 for examples and raw-window-handle to 0.5.0 2022-08-24 00:16:20 -05:00
Liam Murphy
ea6f97e15e Enable needed features of winapi
Previously, `softbuffer` wouldn't successfully build on its own on Windows; the examples only worked because dependencies happened to enable the needed features.
2022-07-01 17:49:40 +10:00
David Johnson
08883d76c5 Bumped version to 0.1.1, updated README.md, added changelog to README.md 2022-05-22 18:20:40 -05:00
Ryan Hileman
ba3b823e1c use CALayer for macOS backend 2022-04-24 07:31:19 -07:00
Liam Murphy
7b4717fdc4 Don't use rayon in examples on wasm 2022-02-23 19:13:26 +11:00
Liam Murphy
d735510f72 Add web support
A limitation of this implementation is that it can't coexist with anything which creates a canvas context other than `CanvasRenderingContext2D`, since only one context can exist per canvas.
2022-02-12 20:24:18 +11:00
David Johnson
bc900e69e7 Added animation demo 2022-01-31 22:03:48 -06:00
David Johnson
4311b27193 Modified Cargo.toml and README.md to prepare for publication to crates.io 2022-01-19 21:57:09 -06:00