Commit graph

167 commits

Author SHA1 Message Date
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
Jeremy Soller
2e926b37e9
Merge pull request #140 from rust-windowing/redox-map-shared
orbital: Use `syscall::MAP_SHARED` for mapping
2023-08-16 20:24:44 -06:00
Ian Douglas Scott
1770b331bf orbital: Use syscall::MAP_SHARED for mapping
This seems to be required to work correctly since
https://gitlab.redox-os.org/redox-os/orbital/-/merge_requests/51.

Orbclient had a similar change:
9097e71c9a.
2023-08-16 18:59:40 -07: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
2689cec2ca
bugfix: Mark fetch as unsupported on Windows for now
This fetch function has been broken and is probably unsound. This also
fixes the flakey Windows CI that we've been dealing with.

Signed-off-by: John Nunley <dev@notgull.net>
2023-08-10 19:28:04 -07:00
Ian Douglas Scott
5463e8741e
Merge pull request #137 from rust-windowing/cg-size
cg: Require non-zero width/height; panic instead of segfault
2023-07-24 19:46:59 -07:00
Ian Douglas Scott
e10c360929 cg: Require non-zero width/height; panic instead of segfault
Fixes https://github.com/rust-windowing/softbuffer/issues/124.
2023-07-24 18:24:23 -07:00
Fenhl
1f326b2199
bugfix: Reintroduce Error trait impl for SoftBufferError 2023-07-12 18:43:49 -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
Ian Douglas Scott
efdfb529ef
Merge pull request #99 from rust-windowing/damage
Add `Buffer::present_with_damage()` and `Buffer::age()`
2023-06-02 20:15:14 -07:00
Ian Douglas Scott
1e7b9213d2 Merge remote-tracking branch 'origin/master' into damage 2023-06-02 15:03:10 -07:00
dAxpeDDa
6be186b47c Reference correct branch name in CI 2023-06-02 11:18:10 +02: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
John Nunley
daf304adf9
fixup: Add changelog entry for 0.2.1
See #110
2023-05-31 19:00:28 -07:00
Ian Douglas Scott
591a40c0a6 Fix doc link 2023-05-30 15:36:14 -07:00
Ian Douglas Scott
a147a15d45 Use u32/NonZeroU32 for Rect, and return error if out of range 2023-05-30 15:27:59 -07:00
Ian Douglas Scott
199a016f44 Merge remote-tracking branch 'origin/master' into damage 2023-05-30 14:25:45 -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
jtnunley
ecfae194ce Add @daxpedda as web maintainer 2023-05-05 16:44:59 +02:00
daxpedda
d7888ef806
Implement present_with_damage for Web (#101) 2023-04-27 10:19:29 -07:00
Ian Douglas Scott
29b3f4a978 Add a Buffer::age() method
Fixes https://github.com/rust-windowing/softbuffer/issues/90.
2023-04-26 15:04:20 -07:00
Ian Douglas Scott
c1d6716eec Add a Buffer::present_with_damage() method
Supported on Wayland, X11, and Win32.

Fixes https://github.com/rust-windowing/softbuffer/issues/39.

try_for_each
2023-04-26 11:58:11 -07:00
John Nunley
f12aa534e1
Merge pull request #100 from LunaWasFlaggedAgain/master
x11: Limit returned shm buffer size
2023-04-24 18:36:39 -07:00
Luna
5efa5d8898 x11: Assert that size >= buffer_size 2023-04-24 20:31:39 -03:00
Luna
c68f41bf10 x11: Limit returned shm buffer size 2023-04-24 19:37:41 -03:00
dependabot[bot]
a958a18346
Bump actions/cache from 1 to 3 (#93)
* Bump actions/cache from 1 to 3

Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Empty commit to re-run CI

That CI failure looks spurious to me.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jtnunley <jtnunley01@gmail.com>
2023-04-18 15:05:23 -07:00
Jeremy Soller
a0b9c5921e
Merge pull request #97 from rust-windowing/example-optimize
examples: Avoid dividing index to get x, y; calculate index from x, y
2023-04-12 07:58:56 -06:00
Ian Douglas Scott
edc5c76180 examples: Avoid dividing index to get x, y; calculate index from x, y
Division is more expensive than multiplication, and this doesn't seem to
be optimize away, so iterating over `(0..height)` and `(0..width)`
provides better performance.

It's good to have the example show the best way to write code using
softbuffer, and this helps when using examples as a benchmark. This will
also be needed if Softbuffer supports formats where `stride` isn't just
`width * pixel_size`, and needs alignment.
2023-04-11 12:21:50 -07:00
dependabot[bot]
6da649e8a1
Bump actions/checkout from 2 to 3 (#92)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-10 10:32:37 -07:00
John Nunley
027f944ece
Add dependabot support to this repo (#91) 2023-04-10 10:00:41 -07:00
John Nunley
92e8eb7d22
Don't use the borrowing trick under Windows (#89) 2023-04-07 17:31:21 -07:00
John Nunley
885c76bf02
m: Don't use the borrowing trick under X11 (#86) 2023-04-07 11:54:50 -07:00
John Nunley
a72e3b5062
Merge pull request #88 from rust-windowing/notgull/error-handling 2023-04-06 13:15:54 -07:00
John Nunley
61eb2472ff
Merge pull request #87 from daxpedda/atomic-ci
Fix atomic Wasm CI
2023-04-06 11:31:12 -07:00
dAxpeDDa
24db0ad453
Fix atomic Wasm CI 2023-04-06 20:21:42 +02:00
jtnunley
74a3357ce8 Use the SwResultExt trait in more places 2023-04-06 11:09:47 -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
7ba535c225
Merge pull request #85 from rust-windowing/bump-deps
Update `windows-sys` and `image`
2023-04-06 09:44:00 -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
e5d546ff9e
Update README.md to have a checkmark next to libxcb support (#84) 2023-04-05 11:41:37 -07:00