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
6 years ago
emersion
2b9cbaddf3
screencopy: add support for frame flags
6 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
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
824a95ad19
matrix: use 2D matrices
7 years ago
emersion
d26b67cb06
matrix: unify API, don't use array pointers
7 years ago
Guido Günther
d08792bfff
Add alpha to wlr_render_with_matrix
...
so we can use the alpha channel to e.g. blend in textures
7 years ago
Drew DeVault
1d9be89e2d
Revert "ELF Visibility"
7 years ago
Scott Anderson
86269052eb
Explicitly export EFL symbols
7 years ago
emersion
c2e1474010
Reformat all #include directives
7 years ago
emersion
ddb1779f9f
render: make wlr_renderer_clear take a float[4] for the color
7 years ago
emersion
51c22d39a4
Merge remote-tracking branch 'upstream/master' into output-damage
7 years ago
emersion
4fa90b0511
Backport screenshooter fixes from the renderer redesign v1
...
This backports some changes to #319 to fix the screenshooter data
format. This also adds wlr_backend_get_renderer which will be
useful to support multiple renderers.
7 years ago
emersion
415a2b7c56
render: add wlr_renderer_clear and wlr_renderer_scissor
7 years ago
emersion
0ce3135304
Move read_pixels from output to renderer
7 years ago
Dominique Martinet
f24b3df980
wlr renderer/texture: rename init to create when it does alloc
7 years ago
Dominique Martinet
4bbf718e7d
impl->destroy cleanup:
...
- remove trivial destroy() function
- make sure we check impl and impl->destroy before calling
- always call free if not implemented
7 years ago
Drew DeVault
2facf1df65
Fix software cursors
7 years ago
Drew DeVault
de6f32c84e
Refactor away wlr_renderer_state
7 years ago
Drew DeVault
c24351681f
Refactor EGL handling
7 years ago
nyorain
e167f41fde
Rename wlr_surface -> wlr_texture; attach -> upload
7 years ago
Drew DeVault
2aafb5dd19
Add wlcore/wl_shm (WIP)
8 years ago
Drew DeVault
2443a070e7
Add colored quad and ellipse rendering primitives
8 years ago
Drew DeVault
cd6a40d816
Further improvements to rendering subsystem
8 years ago