Commit Graph

607 Commits

Author SHA1 Message Date
Victoria Brekenfeld 21a78f9858 gles: Don't apply output transformations to buffer damage 2022-01-17 21:26:06 +01:00
Victor Brekenfeld 439d5a7820 Consistently use buffer coordinates
- Moves `Transform` into utils::geometry
- Changes conversion from and into buffer-coordinates to take
  `Transform` arguments.
- `Renderer` take `Buffer`-space damage now
- buffer_transform is taken into account everywhere
2022-01-16 20:32:17 +01:00
Victor Brekenfeld f76311227b gles2: Apply output transformations for damage 2022-01-16 20:15:38 +01:00
Victor Brekenfeld 5cbd4352b9 renderer: add `transform_rect` 2022-01-12 22:14:53 +01:00
Victor Brekenfeld fefb287fa8 gles2: Fixup texture filtering 2022-01-12 22:14:53 +01:00
Victor Brekenfeld bffae036f7 gles2: Expose transformation of a `Frame` 2022-01-12 22:14:53 +01:00
Victor Brekenfeld 74162a73b6 egl: Expose raw types for downstream integrations 2022-01-12 22:14:53 +01:00
Victor Brekenfeld 20d95c80c6 gles2: Expose `Gles2Frame`s projection matrix 2022-01-12 22:14:53 +01:00
Victor Brekenfeld f4811646be gles2: Expose underlying `EGLContext` 2022-01-12 22:14:53 +01:00
Victor Brekenfeld 6e1f6ab1f3 egl: Add `UserDataMap` to `EGLContext` 2022-01-10 19:31:31 +01:00
Christian Meissl 9f5bf25b6b clamp the damage rect to the destination rect
this fixes issues when the damage rect is greater
than the destination rect, like providing i32::Max as
the damage size
2022-01-07 19:48:43 +01:00
Victor Brekenfeld fafbf300dc desktop: Add missing cfg directives 2022-01-05 21:44:58 +01:00
Victor Brekenfeld 8059bdc5db desktop: docs 2022-01-05 20:48:07 +01:00
Victor Brekenfeld 8e34865acc space: Let downstream `RenderElements` hash `(&Space, &Output)` 2022-01-05 20:46:59 +01:00
Victor Brekenfeld a5f3c5c5d2 clippy fixes 2022-01-05 13:03:55 +01:00
Victor Brekenfeld 537b34fe0b cleanup: imports 2022-01-04 19:06:47 +01:00
Victor Brekenfeld 61b19e4198 renderer: fixup damage calculations for smaller buffer sizes 2022-01-04 18:06:00 +01:00
Victor Brekenfeld 171456c7ba gbm: Support resetting buffers 2022-01-04 12:50:40 +01:00
Victor Brekenfeld 7ae79fcba5 winit: Support damage-tracking 2022-01-04 12:50:40 +01:00
Victor Brekenfeld f423244864 egl: Optionally support buffer age and damage 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 3530ac7335 egl: stop egl spamming nclassified messages 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 64c535464a swapchain: Keep buffers on reset and wipe metadata
We make no guarantees about the buffer contents after a fresh allocation
in smithay anyway, so to avoid expensive recreation of a bunch of
resources, try to keep the buffers on reset and just wipe all its
metadata (most importantly the age).
2022-01-04 12:50:39 +01:00
Victor Brekenfeld 827a3c8c2a desktop: Fixup intersection calls 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 94968e2d0f desktop: track damage per space/output 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 31b308836f renderer: Use fine grained damage for rendering
Up until now we always redrew the whole windows, which worked
fine - except for some transparency issues - but left performance
on the table.

So now we use instancing to render only the actually damaged regions
inside the window, which also fixes our few rendering issues.

We also use a shader now for clearing the screen to use instancing as
well and lower the amount of draw calls at the begin of a frame for
clearing parts of it.

And while we are add it we remove the last rendering artifacts
by optimizing the damage vector by deduplicating and merging rectangles.
2022-01-04 12:50:39 +01:00
Victor Brekenfeld f55f1bbbe0 desktop: handle xdg-popups 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 76787fb7df renderer: Account for OpenGLs coordinate system in the Gles2Renderer 2022-01-04 12:50:39 +01:00
Victor Brekenfeld eccdd5221c renderer: Make Transform::transform_size use a Size instead of u32 2022-01-04 12:50:39 +01:00
Victor Brekenfeld 57f45d9941 renderer: Allow clear calls on specific regions 2022-01-04 12:50:39 +01:00
Victor Berger c232b5c108 backend: Make SwapBuffersError Send+Sync
This makes using anyhow with Smithay easier.
2021-12-29 16:34:53 +01:00
dragonn 5ce5a8abcc call resize after applying new pending model 2021-12-23 17:49:39 +01:00
dragonn 9a7cd23093 make use_mode use the new mode size on test_buffer 2021-12-23 17:47:12 +01:00
Victor Brekenfeld 6d51d1dea0 x11: Don't use modifiers on old dri3 versions
Older dri3 versions (< 1.2) do only support dmabufs with one plane.
Lets limit the modifiers early, if we detect that, so we do not end
up allocating buffers the interface does not accept.
2021-12-22 21:08:44 +01:00
Victor Brekenfeld 94b3ce8e6f x11: Add virtual Device{Added, Removed} events 2021-12-22 19:33:33 +01:00
Victor Brekenfeld cc6225ce21 x11: Move window from Metadata into events
Some events (especially from xinput) cannot be cleanly mapped to a window.
Instead of requiring every event to come with a `Window` reference, move
the window into those events, that have one.
2021-12-22 19:33:33 +01:00
i509VCB ed105528de
x11: emit errors when presentation fails 2021-12-17 19:14:14 -06:00
i509VCB d6051a873f
x11: move X11Surface to submodule to reexport and reorganize internal functions 2021-12-17 16:54:18 -06:00
i509VCB 22204f2845
x11: internal window to send close backend event to 2021-12-17 12:06:30 -06:00
i509VCB b80281dcc8
x11: fix window drop not destroying 2021-12-15 20:04:53 -06:00
i509VCB 09ce3da742 x11: Do not hold lock when dispatching events 2021-12-06 16:39:02 -06:00
i509VCB e4e964c869 x11: rework impl to allow multiple windows 2021-12-03 11:03:51 -06:00
i509VCB 4f26641f8c x11: require wrapping gbm device in an Arc<Mutex<_>> 2021-12-03 11:03:51 -06:00
i509VCB 210ab8fb21 allocator: general impls for Arc<Mutex<_>> and Rc<RefCell<_>> 2021-12-03 11:03:51 -06:00
i509VCB 7358d8c9cb resolve new clippy lints 2021-12-02 18:18:39 -06:00
Victor Brekenfeld bd305dc7ee x11: fixup buffer age
The current code always acquires the buffer it just submitted,
which results in always rendering to a buffer with age "1", although
its contents are older, because the currently held buffer is already
submitted, just not to the swapchain. When it finally is submitted
its age is again set to 1, the other gets its correct age (but too late)
and the circle is repeated again. So lets fix that.
2021-11-29 15:55:27 +01:00
Victor Brekenfeld 485aa2a9c7 swapchain: Do not increase the age of 0-age slots
Slots with an age of 0 were never rendered to. This means
we should not increase their age, when others are submitted
or the renderer might wrongfully assume usuable contents are
available in the buffer.
2021-11-29 15:36:53 +01:00
Victoria Brekenfeld 8a5d030a98 x11: Use swapchain and expose age
Refactors the `X11Surface` to use the `Swapchain` internally,
which gives us a buffer age implemenation, which we can then use
to change the `Present` struct of the X11 backend to provide age
values to the user.

This change also merged the `Present` struct into the surface
because submits should now happen explicitly via a new `submit`-call
instead of being submitted implicitly on drop.
This allows the buffer to be discarded if rendering fails.
2021-11-26 22:24:12 +01:00
Victoria Brekenfeld 6b3a00fc06
Merge pull request #420 from i509VCB/x11/egl-drm
Rework X11 backend to use EGL for finding gbm device and associated commits
2021-11-26 13:43:49 +01:00
Victor Brekenfeld a4f2729608 gbm: expose buffer age 2021-11-24 18:57:51 +01:00
Victor Brekenfeld 6c57e27e5e swapchain: Support buffer age 2021-11-24 18:57:51 +01:00