Simon Zeni
50d2985607
Move render/shm_format functions to render/pixel_format
4 years ago
Simon Ser
b54ef3372d
render: use DRM formats in wlr_renderer_read_pixels
4 years ago
Simon Ser
ddfee63055
render: use DRM formats in wlr_renderer_get_shm_texture_formats
4 years ago
Brandon Dowdy
8aa38fe73e
render/egl: remove *config_attribs and wlr_egl->config
...
Breaking changes:
Both "EGLint *config_attribs" and "wlr_egl->config" no longer exist.
4 years ago
Simon Ser
7c995b78b2
Revert "render: add wlr_egl_create_from_drm_fd function"
...
This reverts commit ee31be167b
.
4 years ago
Simon Ser
54e5ef39c0
Revert "render/egl: remove unused gbm_device member"
...
This reverts commit 306cf11d87
.
4 years ago
Simon Zeni
306cf11d87
render/egl: remove unused gbm_device member
4 years ago
Simon Zeni
ee31be167b
render: add wlr_egl_create_from_drm_fd function
4 years ago
Simon Ser
2f11914613
render: introduce private wlr_renderer_autocreate_with_drm_fd
4 years ago
Simon Zeni
e128e6c08d
render: drop egl parameters from wlr_renderer_autocreate
4 years ago
Simon Ser
1d461687d2
render/egl: replace init/finish with create/destroy
...
This ensures wlr_gles2_renderer can properly take ownership of the
wlr_egl.
Closes: https://github.com/swaywm/wlroots/issues/2612
4 years ago
Simon Ser
76ed2255ef
render/egl: remove support for EGL_NATIVE_VISUAL_ID
...
Nobody uses it anymore.
4 years ago
Simon Zeni
b899a412e3
backend: remove wlr_egl from all backends
4 years ago
Simon Ser
07d75c99db
render: remove EGL config and visual from wlr_renderer_autocreate
...
This isn't used anymore by any backend.
Some examples still provide an EGL config to wlr_egl_init, so we can't
drop it yet there.
4 years ago
Simon Ser
b9460ab724
Stop using wlr_texture_get_size
...
Just use wlr_texture.{width,height} directly.
4 years ago
Simon Ser
037710b1d4
render/egl: support config-less wlr_egl
...
When using wlr_swapchain, there's no need to select an EGLConfig. Add
support for creating config-less EGL contexts.
4 years ago
Simon Ser
1f15dd093d
render: assert {X,A}RGB8888 are supported
...
The Wayland protocol requires those to be supported.
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
Isaac Freund
0724b3c453
Use uint32_t in wlr_renderer_begin signature
...
This matches the signature of wlr_renderer_impl.begin
4 years ago
Guido Cella
6949d0fd38
render: Don't crash on 0 dimensions
...
Don't force compositors to check when an empty shape is being renderered.
References #2282 . This was motivated by dwl crashing when setting window
borders to 0 (djpohly/dwl#51 ).
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
Rouven Czerwinski
d3d1bac1c2
render: assert sane values for box functions
...
Width and height should always be > 0 for render functions which take a
wlr_box.
References https://github.com/swaywm/wlroots/issues/2281
5 years ago
Andri Yngvason
b64a8a7f98
render: Add wlr_renderer_blit_dmabuf()
5 years ago
Simon Ser
d10f8a98ec
render: only expose linux-dmabuf if EGL extension is supported
...
Only expose linux-dmabuf extension if EGL_EXT_image_dmabuf_import_ext is
supported.
Closes: https://github.com/swaywm/wlroots/issues/2076
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
346b43e937
render: guard rendering operations between begin() and end()
...
Add a wlr_renderer.rendering bool, set it to true between
wlr_renderer_begin() and wlr_renderer_end(). Assert we're rendering when
calling functions that render.
5 years ago
emersion
e42178d03f
render: switch wlr_renderer to wlr_drm_format_set
6 years ago
Ilia Bozhinov
fb5691b6cc
output: add wlr_output_preferred_read_format()
...
The read format is dependent on the output, so we first need to make it
current. This fixes a race condition in wlr-screencopy-v1 where a dmabuf
client would cause EGL_NO_SURFACE to be bound at the time when
screencopy needs to query for the preferred format, causing GL errors.
6 years ago
emersion
09550032b7
render: correctly set EGL_RENDERABLE_TYPE
...
This should be set to EGL_OPENGL_ES2_BIT.
Also fixes EGL config attributes in the headless and X11 backends.
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
emersion
2f0815838d
Init dmabuf global in renderer
6 years ago
emersion
7cbef15206
util: add wlr_ prefix to log symbols
7 years ago
emersion
2b9cbaddf3
screencopy: add support for frame flags
7 years ago
Dominique Martinet
4cc4412481
wlr_renderer_destroy: fix renderer NULL check
...
renderer is checked for NULL, but was dereferenced before that.
Found through static analysis
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
6eb4b5b54d
Merge pull request #993 from emersion/bind-wl-drm-in-renderer
...
render: bind wl_drm in renderer
7 years ago
Ilia Bozhinov
24cf70ae96
backends: implement custom EGL and renderer initialization
...
Compositors now have more control over how the backend creates its
renderer. Currently all backends create an EGL/GLES2 renderer, so
the necessary attributes for creating the context are passed to a
user-provided callback function. It is responsible for initializing
provided wlr_egl and to return a renderer. On fail, return 0.
Fixes #987
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
Rostislav Pehlivanov
12298ce88c
Do not advertize *RGB8888 as supported shm formats
...
They're always available and supported, and are added automatically.
Adding them again just duplicates them.
7 years ago
emersion
70d820be25
Add wlr_renderer_init_wl_shm to advertize supported renderer formats
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