Commit Graph

19 Commits

Author SHA1 Message Date
Simon Ser dc2e640a7d buffer: make enum wlr_buffer_cap public
Custom backends and renderers need to implement
wlr_backend_impl.get_buffer_caps and
wlr_renderer_impl.get_render_buffer_caps. They can't if enum
wlr_buffer_cap isn't made public.

(cherry picked from commit a38baec1f8)
2021-07-07 19:24:36 +02:00
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.
2021-06-07 09:22:56 -04:00
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
2021-04-27 20:36:03 +02:00
Simon Ser 6c61de996c buffer: introduce wlr_buffer_get_shm
References: https://github.com/swaywm/wlroots/issues/2399#issuecomment-769408708
2021-04-17 09:54:39 +02:00
Simon Zeni 0b9288ec0b buffer: introduce wlr_buffer_get_data_ptr
The function has been place in an internal header for API stability
reasons.
2021-04-17 09:54:39 +02:00
Simon Ser 0b40d09a21 buffer: add wlr_client_buffer_get 2020-11-15 22:48:42 +01:00
Simon Ser a8a4a12c4b buffer: document wlr_buffer_get_dmabuf DMA-BUF lifetime 2020-06-09 07:12:43 -06:00
Simon Ser 1fa9e0203b buffer: add width and height 2020-04-02 15:03:43 +02:00
Simon Ser 6595db6409 buffer: add a release event
Consumers call wlr_buffer_lock. Once all consumers are done with the
buffer, only the producer should have a reference to the buffer. In this
case, we can release the buffer (and let the producer re-use it).
2020-04-02 15:03:43 +02:00
Simon Ser 1674ca725c buffer: add destroy event 2020-04-02 15:03:43 +02:00
Simon Ser 41f9916ae5 buffer: remove unused wlr_client_buffer fields
Forgot to remove these, they are superseded by fields in wlr_buffer. Some
functions were still using them.

Fixes: 8afc1ed68c ("Introduce wlr_client_buffer")
Closes: https://github.com/swaywm/sway/issues/5087
2020-03-09 19:26:12 +01:00
Simon Ser 8afc1ed68c Introduce wlr_client_buffer
Split out the client/resource handling out of wlr_buffer by introducing
wlr_client_buffer. Make wlr_buffer an interface so that compositors can
create their own wlr_buffers (e.g. backed by GBM, like glider [1]).

[1]: c66847dd1c/include/gbm_allocator.h (L7)
2020-03-06 21:32:06 +01:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
Simon Ser 493804e421 buffer: add wlr_buffer_get_dmabuf 2019-06-07 09:06:11 -04:00
Drew DeVault 211ae764fd Initial pass on API stability guarantees
This introduces -DWLR_USE_UNSTABLE and adds information regarding the
stability status to all headers. I started with a conservative set of
headers to mark as stable:

- types/wlr_matrix.h
- util/edges.h
- util/log.h
- util/region.h
- xcursor.h
2018-07-29 19:20:34 -04:00
emersion 0378d143d9
surface: remove wlr_surface.texture
The texture is managed by the surface's wlr_buffer now. In
particular, the buffer can destroy the texture early if it becomes
invalid.
2018-06-13 19:38:10 +01:00
emersion 38d415dd20
buffer: make wlr_buffer_ref return the buffer 2018-06-11 08:13:35 +01:00
emersion 7d24af43e5
buffer: improve docs 2018-06-08 20:28:57 +01:00
emersion e4933ab445
Introduce wlr_buffer 2018-06-08 20:06:13 +01:00