Alexander Orzechowski
a193d450ed
wlr_scene_buffer: Rework to use wlr_raster
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
605c4aed38
cursor: Move wlr_output_cursor_set_buffer to wlr_raster
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
beaede2df0
wlr_texture: Update wlr_texture_update_from_buffer to use wlr_raster
...
In the future, these implementations can use compatible texture sources
to do fast blit instead.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
1e2af8665b
wlr_texture: Drop wlr_texure_from_buffer
...
Compositors should be using wlr_raster for texture management.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
33ae408579
wlr_texture: Drop wlr_texture_from_pixels
...
Keeping the texture version doesn't make too much sense because compositors
should send valid pixel data the first time around meaning they want to
render straight away. wlr_raster_from_pixels should be used instead.
Also drop a few asserts that are impossible because of the data type.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
dae7bd1413
wlr_texture: Drop wlr_texture_from_dmabuf
...
Compositors should first create a valid dmabuf first, then use normal
apis to use that buffer where needed.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
248a33a026
wlr_renderer: Switch texture rendering functions to take wlr_raster
...
Implements automatic texture uploading as both wlr_scene and cursor
handling both are simplified as a result.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
45ad3d47ad
backend/drm: Report ZERO_COPY hint when direct scanning a client dmabuf.
...
Since wlr_client_buffer is gone, we are now dealing with client dmabufs
directly.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
ba8230b00a
Nuke wlr_client_buffer
...
This abstraction is incompatible with wlr_raster in every way, let's just
use the client submitted buffers directly. This will regress a couple
of things until wlr_raster has been fully integrated.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
d8def1aa65
wlr_renderer: Introduce wlr_renderer_raster_upload
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
5dd7c00a7c
renderer/pixman: Nuke wlr_pixman_texture_get_image
...
Consumers can just get the image from the wlr_pixman_texture.
Getting rid of this will make the transition to use wlr_raster easier.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
bc53c79048
wlr_raster: Introduce wlr_raster_from_pixels
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
31bc571e98
wlr_raster: Introduce new abstraction
2022-07-03 13:09:22 -04:00
Simon Ser
531f0dfbbc
render: replace wlr_texture_write_pixels with update_from_buffer
...
This lets the renderer handle the wlr_buffer directly, just like it
does in texture_from_buffer. This also allows the renderer to batch
the rectangle updates, and update more than the damage region if
desirable (e.g. too many rects), so can be more efficient.
2022-07-03 13:09:22 -04:00
Alexander Orzechowski
5dc1d4671d
wlr_scene: Maintain damage highlight regions per output
...
The logic doesn't support handling multiple outputs so let's not break
the assumption and handle damages per output much like how damage_ring
is done.
2022-07-03 12:21:52 -04:00
Isaac Freund
ffb53a6103
Document NULL return value of foo_from_wlr_surface() functions
...
wlr_xdg_surface_from_wlr_surface() for example may return NULL even if
the surface has the xdg surface role if the corresponding xdg surface
has been destroyed.
2022-07-02 13:28:02 +02:00
Kirill Primak
694b8c6683
scene: add missing output damage listener
...
This is necessary to handle damage coming from the backend and software
cursors.
2022-06-29 21:19:38 +03:00
Kirill Primak
97f0347780
scene: switch to wlr_damage_ring
2022-06-29 18:54:27 +03:00
Kirill Primak
e0accb2d50
types: add wlr_damage_ring
...
wlr_damage_ring is effectively wlr_output_damage untied from wlr_output.
2022-06-29 18:54:21 +03:00
Kenny Levinsen
03dc7e2df5
wlr_{keyboard,pointer,touch}: Update event docs
...
Events used by our input devices were recently renamed from wlr_event_* to
wlr_*_event, but the documentation and a single point of use was not updated
accordingly.
Regressed by: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3484
2022-06-28 09:50:30 +00:00
Isaac Freund
91943a68a6
wlr_input_device: remove anon union field
...
This union is unnecessary since the recent input device refactor and can
now be replaced by wlr_*_from_input_device() functions.
2022-06-21 18:42:07 +00:00
Kirill Primak
5c4384a133
xdg-popup: use configure fields
2022-06-21 15:14:37 +00:00
Simon Ser
d89285f783
output-management-v1: add wlr_output_head_v1_state_apply()
...
This function applies a configuration sent by a client on a
struct wlr_output_state.
2022-06-17 21:05:51 +00:00
Simon Ser
29291cb47c
render/texture: drop wlr_texture_is_opaque
...
Whether a texture is opaque or not doesn't depend on the renderer
at all, it just depends on the source buffer. Instead of forcing
all renderers to implement wlr_texture_impl.is_opaque, let's move
this in common code and use the wlr_buffer format to know whether
a texture will be opaque.
2022-06-16 14:43:24 +02:00
Simon Ser
96b594110d
matrix: remove wlr_matrix_projection()
...
69477051cc ("matrix: deprecate wlr_matrix_projection") marked it
as deprecated. 1 year later, we can now remove it from our public
API.
2022-06-08 19:27:36 +00:00
Simon Ser
6688a3d9ea
output: add output state setters
...
This ensures compositors don't forget to set the committed flag
or the mode_type when setting a field.
2022-06-08 18:22:32 +02:00
Simon Ser
e383c1f1db
xdg-shell: add support for v4
...
This adds a configure_bounds event to let the client know of the
preferred maximum window geometry size.
2022-06-01 18:18:54 +02:00
Kirill Primak
0c2eed533e
scene/output-layout: improve ownership logic
...
This commit ensures that outputs that weren't created by the output
layout helper aren't destroyed on the output layout change.
Consider the following piece of logic:
// struct wlr_output *o1, *o2;
// struct wlr_scene *scene;
// struct wlr_output_layout *layout;
wlr_scene_attach_output_layout(scene, layout);
wlr_output_layout_add_auto(layout, o1);
struct wlr_scene_output *so2 = wlr_scene_output_create(scene, o2);
wlr_output_layout_move(layout, o1, 100, 200);
// so2 is invalid now
2022-06-01 09:49:25 +00:00
Kirill Primak
d3bc17d5d1
scene: add wlr_scene_output.events.destroy
2022-06-01 09:49:25 +00:00
Kirill Primak
ec328ca8cc
scene/wlr_scene.h: fix indentation
2022-05-31 20:34:50 +03:00
Simon Ser
638c5cda51
output: drop wlr_output_cursor.events.destroy
...
Compositors can just listen to wlr_output.events.destroy instead.
2022-05-31 11:40:47 +00:00
Simon Ser
459a642e83
output: introduce wlr_output_cursor_set_buffer
...
This will supersede wlr_output_cursor_set_image, and then later
also supersede wlr_output_cursor_set_surface.
2022-05-31 11:40:47 +00:00
Alexander Orzechowski
71f8a48d38
wlr_scene: Move children list from wlr_scene_node to wlr_scene_tree
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
cb2dbc327e
wlr_scene: Inline wlr_scene_node_state
...
This seems like nothing interesting was done with this. Let's simplify
and allow us some flexibility in the future.
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
ccd0f85c2a
wlr_scene: Only allow parenting on a wlr_scene_tree
2022-05-31 09:14:28 +00:00
Alexander Orzechowski
9eb71146ae
wlr_scene: Refactor wlr_scene (the root element) to encase a wlr_scene_tree
...
Co-authored-by: Isaac Freund <mail@isaacfreund.com>
2022-05-31 09:14:28 +00:00
Simon Ser
bb2946f737
build: make GBM optional
...
Now that the DRM backend no longer depends on GBM, we can make it
optional. The GLES2 renderer still depends on it because of our EGL
device selection.
This is useful for compositors with their own renderers, and for
compositors using the Vulkan renderer.
2022-05-30 13:30:08 +00:00
Simon Ser
d483dd2f4c
output: add wlr_output_commit_state
...
Same as wlr_output_commit, but takes a wlr_output_state.
2022-05-30 11:40:34 +02:00
Simon Ser
b21c26a1c9
output: add wlr_output_event_precommit.state
2022-05-30 11:34:57 +02:00
Simon Ser
c4253fef9c
output: add wlr_output_test_state
...
Same as wlr_output_test, but takes a wlr_output_state argument.
2022-05-30 11:34:57 +02:00
Simon Ser
25dd3cc0cd
output: pass wlr_output_state to backend
...
Groundwork for the following commits. The goal is to allow users
to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-30 11:34:57 +02:00
Kirill Primak
1761c3bbe2
xdg-popup: add reposition support
2022-05-27 13:31:30 +00:00
Kirill Primak
8a0835c59c
xdg-positioner: add v3 parameters
2022-05-27 13:31:30 +00:00
Kirill Primak
6f1fce9cb4
xdg-popup: use current/pending state pattern
2022-05-27 13:31:30 +00:00
Kirill Primak
4a968576e4
xdg-popup: add proper configure flow
2022-05-27 13:31:30 +00:00
Simon Ser
be86145322
output: turn make/model/serial into char *
...
This allows the make/model/serial to be NULL when unset, and allows
them to be longer than the hardcoded array length.
This is a breaking change: compositors need to handle the new NULL
case, and we stop setting make/model to useless "headless" or
"wayland" strings.
2022-05-26 13:36:06 +00:00
Simon Ser
1cb6b2cf67
render/egl: document wlr_egl_create_with_context
2022-05-25 18:17:41 +00:00
Simon Ser
4b3e08c8ac
render/egl: make wlr_egl_{make,unset,is}_current private
...
These are trivial wrappers around eglMakeCurrent and
eglGetCurrentContext. Compositors which need to call these
functions will also call other EGL or GL functions anyways. Let's
reduce our API surface a bit by making them private.
2022-05-25 18:17:41 +00:00
Simon Ser
f954092f22
render/egl: make wlr_egl struct opaque
...
Compositors can use wlr_egl_create_with_context if they need a
custom EGL display or context.
2022-05-25 18:17:41 +00:00
Simon Ser
452a8ec940
render/egl: add wlr_egl_get_{context,display}
...
This allows compositors to integrate with the wlroots GLES2
renderer, if they need to perform custom GL rendering.
2022-05-25 18:17:41 +00:00