Commit Graph

7152 Commits

Author SHA1 Message Date
David Turner
d7f63ab76c render/pixman: Remove half-pixel shift
Reverts 77006e5565.  It turns out this
change really breaks the labwc drop-shadow implementation (which relies
on scaling up single-pixel-wide buffers).

After reverting this there's still something subtley wrong with scaling
pixel locations (shown by `weston-scaler -b`) but I can't see an obvious
way to make both weston-scaler and labwc drop-shadows work in the same
way with pixman and gles2. I'll have a harder look at this but in the
mean time reverting this patch seems to make things less broken on
average.
2024-05-23 11:56:59 +00:00
JiDe Zhang
36c0d5fe3a output: reset hardware_cursor on failure
The DRM backend's set_cursor function always return true if the
buffer is NULL. If using a NULL cursor's buffer on startup, the
wlr_output_cursor will be marked as a hardware cursor. If the
cursor later gains a non-NULL buffer and the DRM backend rejects
that buffer, the cursor will remain marked as a hardware cursor,
despite the backend not displaying it as such. As a result, the
cursor will not be displayed at all. Fix this by always resetting
the hardware_cursor field in output_cursor_attempt_hardware().
2024-05-23 09:32:16 +02:00
nerdopolis
35c3194ae5 backend/libinput: Fix call of handle_libinput_readable() when WLR_LIBINPUT_NO_DEVICES is set 2024-05-21 08:26:04 -04:00
Simon Zeni
325d843814 backend/x11: don't exit on dri3 DRM FD query failure
Even if the backend advertises dri3 support, querying the DRM FD may fail.
Instead of returning early, the backend creation process must continue because
shm might be supported.
2024-05-15 17:54:58 +00:00
Isaac Freund
6219d7b819
wlr_surface: update get_root_surface() docs
Since destroying a wlr_surface now makes all subsurfaces inert, this
function can no longer fail and return NULL. Document this.
2024-05-15 15:54:38 +02:00
Simon Ser
2c4d3ad12d render/vulkan: don't use UNDEFINED layout for imported DMA-BUFs
UNDEFINED when used as source layout means that the contents of
the underlying memory becomes undefined. This isn't what we want
here: we don't want to mutate the imported pixel data.

The Vulkan spec isn't really clear what the proper value should be
here, but after discussing with driver developers [1] it seems like
UNDEFINED isn't the right one. The recommendation is to use GENERAL
instead.

[1]: https://github.com/ValveSoftware/gamescope/issues/356
2024-05-14 13:14:28 +02:00
Alexander Orzechowski
56ebfde540 docs: Add notes about WLR_SCENE_DISABLE_VISIBILITY effectively disabling direct scanout. 2024-05-11 11:59:36 -04:00
Kirill Primak
f0b7fb72a8 render/vulkan: don't free a descriptor set from an already destroyed lut3d dummy pool 2024-05-09 19:07:54 +03:00
Kirill Primak
073c3e8837 render/vulkan: free render format setups on destroy 2024-05-09 18:47:02 +03:00
Kirill Primak
e20ae113f8 render/vulkan: free pipeline layouts on destroy 2024-05-09 18:46:55 +03:00
Kirill Primak
00bc75439f render/vulkan: fix texture clip region leak 2024-05-09 18:40:31 +03:00
Kirill Primak
510664e79b output: disable hardware cursor when falling back to software 2024-05-07 14:47:05 +00:00
Kirill Primak
f534434be6 output: extract hardware cursor disabling logic 2024-05-07 14:47:05 +00:00
Kirill Primak
9c50cd71b6 xdg-toplevel: allow edge_none for resizing 2024-05-07 09:45:58 +03:00
groveer
293b0aa502 wlr_pointer_gestures_v1: emit destroy signal in destroy function 2024-05-06 10:47:33 +03:00
groveer
dead0ebcc8 wlr_pointer_gestures_v1: init destroy signal 2024-05-06 10:46:42 +03:00
Alexander Orzechowski
53be443f39 wlr_scene: Add WLR_SCENE_HIGHLIGHT_TRANSPARENT_REGION env 2024-05-05 02:22:50 +03:00
Kirill Primak
8fdf9dc4f0 scene: fix double scaling of opaque region for blend mode optimization 2024-05-05 01:54:59 +03:00
Kirill Primak
341154a5f6 alpha-modifier-v1: add a missing NULL check in wlr_alpha_modifier_v1_get_surface_state() 2024-05-01 03:07:16 +03:00
Simon Ser
027d453f6a scene/surface: add support for alpha-modifier-v1 2024-04-30 17:49:34 +02:00
Simon Ser
563f100627 alpha-modifier-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/287
2024-04-30 17:49:34 +02:00
Consolatis
8abd43803b xwayland: remove saved_{width,height}
This has been introduced way back in
be297d9d14 but is never used anywhere.

If compositors want to save the old dimensions before reacting to a
fullscreen or maximize event they can just grab the sizes within their
event handlers instead.
2024-04-30 15:24:40 +00:00
Simon Ser
b22bb921d3 ci: convert last remnant from "meson setup" migration
We missed one.

Fixes: 254c5fc752 ("Switch to "meson setup"")
2024-04-30 17:21:14 +02:00
Simon Ser
aa340ade65 render/color: split off lcms2 code
Fixes compilation with color management disabled.
2024-04-30 16:56:03 +02:00
David Turner
77006e5565 render/pixman: half-pixel shift to match GPUs
Add a half-pixel shift in the pixman renderer to match the results given
by GPU-based renderers when scaling.
2024-04-30 14:02:21 +00:00
David Turner
e08d52bbc6 render/pixman: Improve transform performance
The old code to render transformed textures with pixman would run
composite over the whole output regardless of the texture size.  When
rendering something small this caused a huge performance hit.

Rewrite the transform branch of render_pass_add_texture to:
- Only composite over the rectangle we're drawing to
- Generally try to make things a lot clearer and some comments

Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3832
2024-04-30 14:02:21 +00:00
Kenny Levinsen
be667b0628 backend/drm: Free drm device name on error 2024-04-30 10:18:05 +02:00
Simon Ser
3aef433f97 backend/drm: handle errors when fetching DRM name/version
These functions can fail if the FD is not a DRM device or on
memory allocation failure, for instance.
2024-04-30 09:57:28 +02:00
Manuel Stoeckl
82b4bc3f5f renderer: add field to indicate color transform support 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
391410deb5 wlr_scene: add color transform argument for rendering 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
ffdbfdbbbd render/vulkan: add support for output color transforms 2024-04-26 17:17:36 +00:00
Manuel Stoeckl
e443434876 render/vulkan: create plain framebuffers on demand
This change makes it possible to support both the direct srgb-format
pipeline and indirect (color-managed, or non-srgb-format) pipeline
for the same render buffer.
2024-04-26 17:17:36 +00:00
Manuel Stoeckl
adbfd3c321 render/vulkan: add lut3d output shader option
While a corresponding pipeline is created, it is not yet used.
2024-04-26 17:17:36 +00:00
Manuel Stoeckl
c64144a39b render/vulkan: add dummy 3d lookup table to output shader
Later commits will add shader options that use a real 3d
lookup table.
2024-04-26 17:17:36 +00:00
Simon Ser
895e3d18b9 render/color: introduce wlr_color_transform
Co-authored-by: Manuel Stoeckl <code@mstoeckl.com>
2024-04-26 17:17:36 +00:00
David Turner
ee0007c0f2 render/pixman: Fix source crop
Fix source crop in the pixman render backend.  It was being applied by
using a source offset as arguments to pixman_image_composite32().  But
this is wrong because the source crop should get applied before all the
other transforms, not after them (or at least this is how it works in
the other wlroots render backends).  Instead, apply the source crop as
yet another matrix transform when we're doing transforms (Or keep it the
same as previously if there's no other transforming going on).

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3830
2024-04-26 16:12:38 +00:00
David Turner
061b996768 render/pixman: fix flipped transforms
The translations for flipped offsets were set the same as non-flipped
ones which was totally wrong and meant that any textures with
flipped-transforms rendered entirely outside the viewport and were
basically invisible.
2024-04-26 16:12:38 +00:00
Alexander Orzechowski
41fd552f53 wlr_scene: Set wlr_damage_ring_set_bounds earlier
Fixes the _HIGHLIGHT option not highlighting the buffer correctly after
a resize
2024-04-24 12:58:17 -04:00
Alexander Orzechowski
1dc44a1afe wlr_scene: Schedule new frame for WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT in output commit handler
We were doing it too early before and the output would disregard a
scheduled frame if called when we were first putting together the output
state
2024-04-24 12:58:17 -04:00
Alexander Orzechowski
14692a7c55 wlr_scene: Fix WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT output damage 2024-04-24 12:58:17 -04:00
Consolatis
e70afebfc9 scene: do not reset scene_buffer state on buffer release
This fixes an issue with some buffers not rendering anymore due
to buffer_width and buffer_height being reset on buffer release.
2024-04-23 19:37:28 +02:00
Simon Ser
ebef710746 renderer: replace get_render_buffer_caps() with struct field 2024-04-22 11:38:30 +02:00
Simon Ser
0686666cf5 render: drop wlr_renderer_get_dmabuf_texture_formats()
wlr_renderer_get_texture_formats() with WLR_BUFFER_CAP_DMABUF is
the replacement.
2024-04-21 11:27:29 +00:00
Simon Ser
85c1eda721 render: unify getter for texture formats
Instead of having separate getters for shm formats and DMA-BUF
formats, use the same pattern as wlr_output_impl.get_primary_formats
with a single function which takes buffer caps as input.
2024-04-21 11:27:29 +00:00
Ilia Bozhinov
c63275d75e xwayland: add a size-safe wrapper for xcb_send_event
xcb_send_event expects the caller to always provide 32 byte data, even if the actual event struct is
smaller than that.

Reference: https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/18
2024-04-20 15:12:45 +02:00
Simon Zeni
cc10a5259d backend/libinput: avoid potential NULL access in wlr_libinput_get_device_handle 2024-04-18 16:47:09 +02:00
Simon Zeni
8221c487ed xcursor/wlr_xcursor: properly clean xcursor in case of realloc failure in load_callback 2024-04-18 16:47:07 +02:00
Ilia Bozhinov
75ecba444a seat: add serials to touch up events 2024-04-18 14:34:51 +00:00
Kirill Primak
2f82c92307 Avoid using wayland-{client,server}.h
Their use is discouraged. Instead, include -core or -protocol headers.
2024-04-17 13:37:12 +00:00
Isaac Freund
cb01c63a8d
scene: ensure layer surface usable area >0
Clients may, for example, commit an exclusive zone larger than the
output dimensions. Compositors must handle this gracefully, which likely
requires more work on the compositor side but returning a usable area
with negative width or height in wlr_scene_layer_surface_v1_configure()
is nonsensical.
2024-04-16 11:49:08 +02:00