Simon Ser
9d55f712e3
render: introduce wlr_texture_from_buffer
...
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.
4 years ago
Simon Zeni
982498fab3
render: introduce renderer_get_render_buffer_caps
4 years ago
Simon Zeni
84dea55b20
render: rename get_dmabuf_render_formats into get_render_formats
4 years ago
Simon Ser
a109a80dca
render: drop support for ellipses
...
For anything more complicated than quads, compositors can easily
ship their own shaders.
Closes: https://github.com/swaywm/wlroots/issues/2759
4 years ago
Simon Ser
9ecfa4343a
render: remove wlr_texture_to_dmabuf
...
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.
4 years ago
Simon Ser
1cdef8da57
render: drop wlr_renderer_blit_dmabuf
...
It can be replaced with wlr_renderer_bind_buffer. blit_dmabuf is
broken as-is (dies on an assertion).
4 years ago
Simon Ser
cf5b09ede2
Remove unnecessary wayland-server-protocol.h includes
4 years ago
Simon Ser
27fba3df43
render: use DRM formats in wlr_texture_from_pixels
4 years ago
Simon Ser
b54ef3372d
render: use DRM formats in wlr_renderer_read_pixels
4 years ago
Simon Ser
00bf6674b3
output: use DRM format in wlr_output_preferred_read_format
4 years ago
Simon Ser
ddfee63055
render: use DRM formats in wlr_renderer_get_shm_texture_formats
4 years ago
Simon Zeni
9192c0480a
remove unnecessary egl includes
4 years ago
Simon Ser
c94ab99ae2
render: rename wlr_renderer_get_formats
...
Rename wlr_renderer_get_formats to wlr_renderer_get_shm_texture_formats.
This makes it clear those formats are only suitable for shm import.
4 years ago
Simon Ser
49115e9d5d
render: rename wlr_renderer_get_dmabuf_formats
...
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.
4 years ago
Simon Ser
5d008d9030
render: introduce wlr_renderer_get_dmabuf_render_formats
...
It describes which DMA-BUF formats can be used to render.
4 years ago
Simon Ser
61612ecb36
render: remove wlr_renderer_format_supported
...
Instead, callers can just use wlr_renderer_get_formats and iterate over
the list.
This function was unused in wlroots.
4 years ago
Simon Ser
eb8360bda3
render: introduce wlr_renderer_get_drm_fd
4 years ago
Simon Ser
c88c54fb38
render: introduce wlr_renderer_bind_buffer
4 years ago
Simon Ser
f0ddcd361e
render: define EGL_NO_PLATFORM_SPECIFIC_TYPES ( #2452 )
...
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
4 years ago
Simon Ser
315bf08733
render: add wlr_render_subtexture_with_matrix
...
This renders only a subset of the texture, instead of the full texture.
5 years ago
Andri Yngvason
b64a8a7f98
render: Add wlr_renderer_blit_dmabuf()
5 years ago
Simon Ser
06f4c3945d
render/texture: add width and height fields
...
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.
5 years ago
Isaac Freund
c682d97841
Return failure of wlr_renderer_init_wl_display()
...
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.
5 years ago
Simon Ser
7f2bd0b211
render: unconditionally disable implicit X11 includes
...
Even if the X11 backend or Xwayland is enabled, we don't rely on
EGL/egl.h including Xlib headers.
5 years ago
Danilo Spinella
41cbb80e25
Add new define EGL_NO_X11 for newer mesa library
...
Define both MESA_EGL_NO_X11_HEADERS and EGL_NO_X11 for
backward combatibility.
5 years ago
emersion
e42178d03f
render: switch wlr_renderer to wlr_drm_format_set
6 years ago
Jente Hidskes
ed5296c6cf
Protect against redefining MESA_EGL_NO_X11_HEADERS
6 years ago
emersion
51bfdd620e
Use #if instead of #ifdef for wlroots config data
...
This prevents some annoying issues when e.g. not including wlr/config.h or
making a typo in the guard name.
6 years ago
Cedric Sodhi
beefec3326
Tell Mesa not to attempt X11 headers
...
If no X11 related things are being built, tell Mesa's eglplatform.h not to attempt inclusion of associated X11 header.
6 years ago
emersion
62d646f2b8
render/gles2: remove assumptions about supported formats
...
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.
6 years ago
nyorain
cd28637187
Remove fmt parameter from wlr_texture_write_pixels
...
It's not allowed to change the format of a texture so remove
the confusing parameter.
6 years ago
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
6 years ago
emersion
c4915d1492
render: add wlr_texture_is_opaque
6 years ago
emersion
2b9cbaddf3
screencopy: add support for frame flags
7 years ago
emersion
57548b557a
Merge branch 'master' into screencontent
7 years ago
emersion
21928cbe61
Merge branch 'master' into screencontent
7 years ago
emersion
135721118a
render: remove wlr_renderer_check_import_dmabuf
...
It's possible to implement it outside the renderer, by creating a
texture and destroying it right away. This reduces the API surface
of the renderer.
7 years ago
emersion
28020ff577
Only allow one modifier per DMA-BUF, split attributes struct in render/
7 years ago
emersion
5ba1a9af56
render: add wlr_texture_to_dmabuf
7 years ago
emersion
41130fe54b
render: bind wl_drm in renderer
7 years ago
emersion
449f06556a
Destroy wlr_surface with wlr_renderer
7 years ago
emersion
d2ebbd103c
backend: remove wlr_backend_get_egl
7 years ago
emersion
adf4fb08dd
Merge branch 'master' into texture-redesign
7 years ago
emersion
793c3b3047
render: add simple functions to render rectangles and ellipses
7 years ago
emersion
c63d94483b
Redesign wlr_texture
...
- Textures are now immutable (apart from those created from raw
pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions
Fun fact: this patch has been written 10,000 meters up in the air.
7 years ago
emersion
3581573bdc
render/gles2: make wlr_renderer_begin take viewport size
...
This allows raw GL calls outside wlr_renderer to be removed.
7 years ago
emersion
95e86e675a
render/gles2: remove global state, use OpenGL debug extension
7 years ago
emersion
c41de2d1be
render: split render.h into wlr_renderer.h and wlr_texture.h
7 years ago
emersion
876f07e9f1
renderer: replace wlr_texture_get_matrix by wlr_render_texture
7 years ago
emersion
8b58e1a3ad
Merge branch 'master' into matrix-redesign
7 years ago