Commit graph

45 commits

Author SHA1 Message Date
Ian Douglas Scott
015f61922b Update libcosmic 2024-02-06 13:32:29 -08:00
Ian Douglas Scott
6e9119a988 Seperate node from BufferBacking
Should help for moving from `BufferBacking` to types provide by
iced-sctk.
2024-01-26 14:37:18 -08:00
Ian Douglas Scott
a90a3a16b2 Simplify buffer creation code 2024-01-26 14:30:23 -08:00
Ian Douglas Scott
d869a29be7 Have .mmap member for Buffer for both shm and dmabuf 2024-01-26 14:23:04 -08:00
Ian Douglas Scott
2164c1ea5a Create shm buffer directly instead of using RawPool
Currently needed if we want an fd to pass to iced-sctk for subsurfaces.
Rather than a wl_buffer.

It would be good if this logic and the dmabuf type could be shared in
some crate.
2024-01-26 14:13:58 -08:00
Ian Douglas Scott
2b3773c88e Handle gbm::Modifier::Invalid 2024-01-25 18:35:25 -08:00
Ian Douglas Scott
01a64b11fa Add scheduler for async in wayland thread 2024-01-25 17:06:28 -08:00
Ian Douglas Scott
7ae2dc9e06 Fix reference to back buffer 2024-01-25 16:21:21 -08:00
Ian Douglas Scott
9faaa4d6c8 Use array instead of tuple for screencopy swapchain
Can switch to triple buffering by changing one character.
2024-01-25 16:16:26 -08:00
Ian Douglas Scott
6e422b740c Call attach_buffer_and_commit before reading front buffer
This way double buffering is somewhat useful; we can start another
capture before reading out the buffer.
2024-01-25 16:00:37 -08:00
Ian Douglas Scott
89910b8e75 Use double-buffering for screencopy
Currently this is unnecesssary, but it's needed if we use subsurfaces
(or import) instead of immedaitely converting to an image.
2024-01-25 15:58:34 -08:00
Ian Douglas Scott
6262329635 Clean up some of the screencopy code 2024-01-25 15:48:40 -08:00
Ian Douglas Scott
13b565e013 Add a ScreencopySession type
Allows cleaning up some of the relationship between `screencopy.rs` and
`capture.rs`, and groups variables that go together and are set to `Some`/`None`
together.

Should help for adding double buffering.
2024-01-25 15:44:30 -08:00
Ian Douglas Scott
43e9ef390a Move attach_buffer_and_commit 2024-01-24 16:07:00 -08:00
Ian Douglas Scott
6f1b391b00 Destroy screencopy session when not capturing 2024-01-24 15:59:18 -08:00
Ian Douglas Scott
b958a13b88 Remove outdated comment 2024-01-24 15:30:41 -08:00
Ian Douglas Scott
14d2a66c9d Re-use screencopy session instead of creating one each frame 2024-01-24 15:29:03 -08:00
Ian Douglas Scott
5269356089 Use Weak<Capture> in session state 2024-01-24 13:59:18 -08:00
Ian Douglas Scott
80e4fb0227 Work around panic 2023-12-12 11:59:32 -08:00
Ian Douglas Scott
c939486ce6 Fix a panic 2023-12-06 15:35:25 -08:00
Ashley Wulber
791441ca10 refactor: single instance 2023-11-21 19:26:12 -05:00
Ian Douglas Scott
0c19ea7167 Add CaptureImage type 2023-11-16 19:38:42 -08:00
Ian Douglas Scott
eb38e3c3ba Fix lints 2023-11-16 13:42:19 -08:00
Ian Douglas Scott
96389fa999 Remove manual Hash impl
Added support for this to wayland-rs.
2023-11-16 13:38:37 -08:00
Ian Douglas Scott
7f1f46c9c7 Error handling when creating gbm buffers 2023-11-16 13:36:38 -08:00
Ian Douglas Scott
295fee8796 Support creating wl_buffer for multi-planar dmabuf
Apparently `I915_y_tiled_ccs` is a 2 plane format.
2023-11-16 13:23:26 -08:00
Ian Douglas Scott
39401bf3c3 screencopy: Pass the node we're using to attach_buffer
Seems to make sure the compositor renders workspace with that GPU, so it
actually captures successfully.
2023-11-09 13:45:28 -08:00
Ian Douglas Scott
549d9c1ff4 Use correct stride for reading dmabufs 2023-11-08 16:28:53 -08:00
Ian Douglas Scott
f585cbc32f Inital support for allocating dmabufs 2023-11-08 15:51:12 -08:00
Ian Douglas Scott
c567cb30d3 Move Bufffer::new to AppData::create_buffer
Will be needed to add support for dmabuf buffers. Also slightly cleaner
in general.
2023-11-08 15:05:45 -08:00
Ian Douglas Scott
6fc90b6f2c Open GBM main device
Not yet used.
2023-11-08 14:54:42 -08:00
Ian Douglas Scott
9a822bd76d Add dmabuf protocol handler
Not used yet.
2023-11-08 14:32:33 -08:00
Ian Douglas Scott
b1d986ee71 Remove workaround for compositor issue that should be fixed 2023-11-08 14:09:34 -08:00
Ian Douglas Scott
9598a9f8e4 Use WlOutput instead of output names for matching
With a shared wayland connection between the code here and iced, if we
don't bind outputs outselves, we can have `WlOutput`s that match.

This simplifies things.
2023-11-08 13:59:53 -08:00
Ian Douglas Scott
96cd334b81 Share wayland connection with iced-sctk instead of creating new one 2023-11-08 13:31:13 -08:00
Ian Douglas Scott
01b007ef83 Update dependencies 2023-11-03 13:06:43 -07:00
Ian Douglas Scott
970b07fa58 Fix panic in background thread 2023-07-20 15:42:32 -07:00
Ian Douglas Scott
078fc31713 Update libcosmic/iced for advanced text rebase 2023-05-12 13:25:19 -07:00
Ian Douglas Scott
4e2ef433fd Handle global workspaces 2023-03-22 10:03:18 -07:00
Ian Douglas Scott
69a877894a Update dependencies 2023-03-16 14:08:20 -07:00
Ian Douglas Scott
4ca7c9fb56 Handle toplevel info updates 2023-02-10 13:41:08 -08:00
Ian Douglas Scott
b5931cd240 Initial support for filtering what to capture to only what's needed 2023-02-10 10:12:26 -08:00
Ian Douglas Scott
b29f1149a4 Split up wayland code into more files 2023-02-09 16:04:36 -08:00
Ian Douglas Scott
a5b78a4300 Clippy fixes 2023-02-09 14:29:34 -08:00
Ian Douglas Scott
8c690e9648 Split wayland buffer code into a file 2023-02-09 14:10:31 -08:00