Age | Commit message (Collapse) | Author |
|
|
|
Goals:
- Extensibility: we need to be able to add new params to the calls
to render a texture/rect. For instance we'll need to add fences to
the render texture operation for explicit sync purposes.
- No implicit state: no more bind_buffer, begin, end.
- No matrices: these hurt Pixman and we don't need them.
- Clip regions for optimized damage repainting.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3188
|
|
|
|
Make it return a bool to indicate success/failure. Adapt the
various implementations to check errors.
|
|
|
|
These are unused.
|
|
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.
|
|
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.
|
|
Now that we have our own wl_drm implementation, there's no reason
to provide custom renderer hooks to init a wl_display in the
interface. We can just initialize the wl_display generically,
depending on the renderer capabilities.
|
|
|
|
Everything needs to go through the unified wlr_buffer interface
now.
If necessary, there are two ways support for
EGL_WL_bind_wayland_display could be restored by compositors:
- Either by using GBM to convert back EGL Wayland buffers to
DMA-BUFs, then wrap the DMA-BUF into a wlr_buffer.
- Or by wrapping the EGL Wayland buffer into a special wlr_buffer
that doesn't implement any wlr_buffer_impl hook, and special-case
that buffer type in the renderer.
|
|
|
|
|
|
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: 982498fab3c4 ("render: introduce renderer_get_render_buffer_caps")
|
|
This adds a a function to create a wlr_texture from a wlr_buffer.
The main motivation for this is to allow the renderer to create a
single wlr_texture per wlr_buffer. This can avoid needless imports
by re-using existing textures.
|
|
|
|
|
|
For anything more complicated than quads, compositors can easily
ship their own shaders.
Closes: https://github.com/swaywm/wlroots/issues/2759
|
|
This is unused in wlroots, and the use-cases for compositors are
pretty niche since they can access the original DMA-BUF via the
wlr_buffer.
|
|
It can be replaced with wlr_renderer_bind_buffer. blit_dmabuf is
broken as-is (dies on an assertion).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rename wlr_renderer_get_formats to wlr_renderer_get_shm_texture_formats.
This makes it clear those formats are only suitable for shm import.
|
|
Rename wlr_renderer_get_dmabuf_formats to
wlr_renderer_get_dmabuf_texture_formats. This makes it clear the formats
are only suitable for creating wlr_textures.
|
|
It describes which DMA-BUF formats can be used to render.
|
|
Instead, callers can just use wlr_renderer_get_formats and iterate over
the list.
This function was unused in wlroots.
|
|
|
|
|
|
This avoids Xlib.h inclusion via EGL headers. See [1] for discussion.
This change is based on a Weston commit [2].
[1]: https://github.com/KhronosGroup/EGL-Registry/pull/111
[2]: https://gitlab.freedesktop.org/wayland/weston/commit/526765ddfdfd
|
|
This renders only a subset of the texture, instead of the full texture.
|
|
|
|
Instead of requiring compositors to call wlr_texture_get_size each time
they want to access the texture's size, expose this information as
wlr_texture fields.
|
|
This makes it easier for the user of this library to properly handle
failure of this function.
The signature of wlr_renderer_impl.init_wl_display was also modified to
allow for proper error propagation.
|
|
Even if the X11 backend or Xwayland is enabled, we don't rely on
EGL/egl.h including Xlib headers.
|
|
Define both MESA_EGL_NO_X11_HEADERS and EGL_NO_X11 for
backward combatibility.
|
|
|
|
|
|
This prevents some annoying issues when e.g. not including wlr/config.h or
making a typo in the guard name.
|
|
If no X11 related things are being built, tell Mesa's eglplatform.h not to attempt inclusion of associated X11 header.
|
|
We were assuming GL_BGRA_EXT was always supported.
We now check that it's supported for rendering. We fail if it isn't because
this format is specified as "always supported" by the Wayland protocol.
We also check if it's supported for reading pixels. A new preferred_read_format
function returns the preferred format that can be used to read pixels. This is
used by the screencopy protocol.
|
|
It's not allowed to change the format of a texture so remove
the confusing parameter.
|
|
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
|
|
|
|
|
|
|
|
|