Simon Ser
8a3cd28973
render/pixman/pixel_format: add more formats
...
Add a bunch of new formats for Pixman: a few missing 32-bit ones,
some 16-bit and 32-bit formats as well.
Mostly based on a Weston patch [1].
[1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/664
3 years ago
Vyivel
a362d21d6b
render/pixman: fix texture_is_opaque()
...
A texture is opaque when it does *not* have alpha.
Fixes https://github.com/swaywm/wlroots/issues/2907
3 years ago
Simon Zeni
e192d87731
move wlr_box from /types to /util
3 years ago
Simon Ser
18adb43a44
render: drop wlr_renderer_impl.texture_from_pixels
3 years ago
zccrs
3c03639cd5
render: add get native paint target of renderer
...
Add wlr_pixman_buffer_get_current_image for wlr_pixman_renderer.
Add wlr_gles2_buffer_get_current_fbo for wlr_gles2_renderer.
Allow get the FBO/pixman_image_t, the compositor can be add some
action for FBO(for eg, attach a depth buffer), or without pixman
render to pixman_image_t(for eg, use QPainter of Qt instead of pixman).
3 years ago
zccrs
dc17ecd236
render/pixman: add wlr_*_is_pixman and wlr_pixman_texture_get_image
...
Add the following functions:
- wlr_renderer_is_pixman
- wlr_texture_is_pixman
- wlr_pixman_texture_get_image
3 years ago
Simon Ser
2806154900
render: add missing arg to wlr_renderer_impl.get_buffer_caps
...
The types of buffers supported by the renderer might depend on the
renderer's instance. For instance, a renderer might only support
DMA-BUFs if the necessary EGL extensions are available.
Pass the wlr_renderer to get_buffer_caps so that the renderer can
perform such checks.
Fixes: 982498fab3
("render: introduce renderer_get_render_buffer_caps")
4 years ago
Simon Ser
625c66ef75
render/pixman: implement texture_from_buffer
4 years ago
Simon Ser
38ba5881a0
buffer: replace get_data_ptr with {begin,end}_data_ptr_access
...
This new API allows buffer implementations to know when a user is
actively accessing the buffer's underlying storage. This is
important for the upcoming client-backed wlr_buffer implementation.
4 years ago
Simon Ser
f73c04b801
render/pixman: avoid sqrt() in render_quad without rotation
...
When the matrix doesn't have a rotation, we can avoid a sqrt() call.
Tested with Sway's tabbed containers.
4 years ago
Simon Zeni
982498fab3
render: introduce renderer_get_render_buffer_caps
4 years ago
Simon Ser
3a04fb4560
render/pixman: check format is supported in create_buffer
4 years ago
Simon Ser
24fde77c62
buffer: add format param to get_data_ptr
...
Allow wlr_buffer_impl.get_data_ptr to return a format.
This allows the Pixman renderer to not care about get_dmabuf/get_shm,
and only care about get_data_ptr. This will also help with [1], because
client wl_shm buffers can't implement get_shm.
[1]: https://github.com/swaywm/wlroots/pull/2892
References: https://github.com/swaywm/wlroots/issues/2864
4 years ago
Simon Zeni
144b41a45c
pixman: implement read pixels
4 years ago
Simon Zeni
30706b71fb
render/pixman: implement preferred_read_format
4 years ago
Simon Ser
c314920a3d
render: remove NULL checks in wlr_texture_impl.destroy
...
The NULL check already exists in wlr_texture_destroy, no need to
duplicate it in each impl
4 years ago
Simon Ser
8ca2b4cf49
render/pixman: destroy textures on renderer teardown
4 years ago
Simon Ser
9901d49fa5
render/pixman: cleanup when renderer is destroyed
...
We were leaking wlr_pixman_buffers and a wlr_drm_format_set.
4 years ago
ayaka
ed1924800d
render: make GLES2 renderer optional
...
Allow selecting whether the GLES2 renderer gets enabled.
Co-authored-by: Simon Ser <contact@emersion.fr>
4 years ago
Simon Zeni
0d90dddfab
render: introduce pixman renderer
4 years ago